Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
ftp(1) OSS Shell and Utilities Reference Manual
the login process and command macro definitions for the remote host. If the $HOME/.netrc file
or autologin entry does not exist, ftp prompts you for a username and password. This occurs
whether or not the hostname is entered on the command line.
If ftp finds a $HOME/.netrc autologin entry for the specified host, ftp attempts to use the informa-
tion in that entry to automatically log into the remote host. The
ftp command also loads any com-
mand macros defined in the entry. In some cases (for example, when the required password is not
listed in an autologin entry), ftp prompts for the password before displaying the ftp> prompt.
Once ftp completes the autologin process, ftp executes the init macro if the macro is defined in the
autologin entry. If the init macro does not exist or does not contain a quit or bye command, ftp
then displays the prompt and waits for a subcommand.
The remote username that you specify either at the prompt or in a $HOME/.netrc file must exist
and have a password defined at the remote host, or ftp fails.
The ftp command interpreter, which handles all commands entered at the ftp> prompt, provides
facilities that are not available with most file transfer programs, such as: the handling of filename
arguments to ftp commands, the ability to collect a group of commands into a single command
macro, and the ability to load macros from a $HOME/.netrc file. These facilities are designed to
allow simplifying repeated tasks and to allow using ftp in unattended mode.
The command interpreter handles filename arguments according to the following rules:
• If a - (dash) is specified for the argument, standard input is used for read operations and
standard output is used for write operations.
• Failing the preceding check, if globbing is enabled, local filenames are expanded accord-
ing to the rules used in csh; (see the glob subcommand). If the ftp command expects a
single local file (for example, put), the pattern-matching characters following the put
command are interpreted as a file name.
• For get and mget subcommands with unspecified local filenames, the local filename is the
same as the remote filename, which may be altered by a case, ntrans,ornmap setting.
The resulting filename can then be altered if runique is on.
• For mput commands and put commands with unspecified remote filenames, the remote
filename is the same as the local filename, which can be altered by a ntrans or nmap set-
ting. The resulting filename can then be altered by the remote server if sunique is on.
• If the first argument is /G, the Guardian file space is accessed. The "G" must be capitalized
(upper case) to access Guardian file space.
To end an ftp session when you are running interactively, use the bye or quit subcommand or the
End-of-File key sequence at the ftp> prompt. To end a file transfer before it has been completed,
use the Interrupt key sequence. The default Interrupt key sequence is <Ctrl-c>.
The stty command can be used to redefine this key sequence. Sending transfers (those from the
local host to the remote host) are normally halted immediately. Receiving transfers are halted by
sending an FTP ABOR instruction to the remote FTP server and discarding all incoming file
transfer packets until the remote server stops sending them.
If the remote server does not support the ABOR instruction, the ftp> prompt will not appear until
the remote server has sent all of the requested files. Additionally, if the remote server does some-
thing unexpected, the local ftp process may need to be ended manually.
3−156 Hewlett-Packard Company 527188-003