SSH Reference Manual
• binary
changes to binary transfer mode.
The following sample illustrates how ASCII files can exchanged with an SSH daemon on a Windows server:
sftp> ascii dos
Newline convention is now dos
File transfermode is now ascii
sftp> put textfile textfile.txt
Uploading textfile to /test/textfile.txt
sftp> get textfile.txt editfile
Fetching /test/textfile.txt to editfile
sftp>
In the above sample "editfile" is created as Guardian edit file (code 101), with the file correctly converted from the DOS
ASCII format used by Windows.
When writing Guardian edit files SFTP and SFTPSERV convert TAB characters to spaces like FTP/FTPSERV if
decimal line numbering is enabled (i.e. if parameter SFTPEDITLINESTARTDECIMALINCR is greater than or equal to
0 and parameter SFTPEDITLINENUMBERDECIMALINCR is not equal to 1000).
Fix Command and Command History
Within SFTP or SFTPOSS it is possible to list, modify and re-execute commands previously issued within the same
SFTP or SFTPOSS session.
Command History
Historic commands are displayed when the HISTORY command is entered, e.g.:
sftp> history
1> ls -l k*
2> get file678
3> put report89
4> cd $disk.subvol
5> cd $data1.reports
6> pwd
sftp>
A maximum of 50 commands are saved. If only a smaller number of commands in the history list is of interest, a
numeric parameter can be used to specify the number of commands, e.g.:
sftp> history 4
1> ls –l k*
2> get file678
3> put report89
4> cd $disk.subvol
sftp>
A string can be specified after the history command that controls the selection of historic lines: Only those lines of the
history list are displayed that contain the supplied string, for example:
sftp> history t8
3> put report89
sftp>
History Mode
There are two different modes that can be set to manage the history list. The mode must be set via PARAM/environment
variable HISTORYMODE before starting the SFTP[OSS] client, i.e. in the process environment of the SFTP[OSS]
client.
236 • SSH and SFTP Client Reference HP NonStop SSH Reference Manual