kermit(1)
NAME
kermit − kermit file transfer
SYNOPSIS
kermit [options] [file]
DESCRIPTION
kermit is a file transfer program for moving files between many machines of different operating systems and architectures.
Arguments are optional. If kermit is executed without arguments, it enters command mode. Otherwise, kermit parses the arguments from the command line and interprets them.
The following terms are used in the command descriptions that follow:
fn HP-UX file specification, possibly containing the "wildcard" characters * or ? (* matches all character strings, ? matches any single character).
fn1 HP-UX file specification which must not contain * or ?.
rfn Remote file specification in the remote system’s own syntax. May denote a single file or a group of files.
rfn1 Remote file specification which should denote only a single file.
n Decimal number between 0 and 94.
c Decimal number between 0 and 127 representing the value of an ASCII character.
cc Decimal number ranging from 0 through 31 or exactly 127, which represents the value of an ASCII control character.
[ ] Any field in square braces is optional.
{x|y|z} Alternatives are listed in curly braces.
kermit command line options can specify either actions or settings. If kermit is invoked with a command line that specifies no actions, it issues a prompt and begins interactive dialogue. Action options specify either protocol transactions or terminal connection.
The command line must contain no more than one protocol action option.
Action Options
kermit recognizes the following action options:
-s fn Send the specified file or files. If fn contains wildcard (meta) characters the HP-UX shell expands it into a list. If fn is -, kermit sends from standard input, which must come from a file:
kermit -s - < foo.bar
or a pipeline:
ls -l | kermit -s -
This mechanism cannot be used to send terminal type-in. To send a file whose name is - precede the file name with a path name, as in
kermit -s ./-
-r Receive a file or files. Wait passively for files to arrive.
-k Receive (passively) a file or files, sending them to standard output. This option can be used in several ways:
Display incoming files on your terminal (can be used only in “local mode” — see below):
kermit -k
Send incoming file or files to a named file. If more than one file arrives, all are concatenated together into the single file fn1:
kermit -k > fn1
Pipe incoming data (single or multiple files) to the indicated command:
kermit -k | command
For example:
kermit -k | sort > sorted.stuff
-a fn1 If you have specified a file transfer option, you can also specify an alternate name for a single file by using the -a option. For example,
kermit -s foo -a bar
sends the file foo telling the receiver that its name is bar. If more than one file arrives or is sent, only the first file is affected by the -a option. To store the first incoming file under the name baz:
kermit -ra baz
-x Begin server operation. Can be used in either local or remote mode.
Setting Options
kermit recognizes the following setting options:
-l dev Line − Specify a terminal line to use for file transfer and terminal connection, as in
kermit -l /dev/tty1p4
The -l option places kermit in "local" mode (see below).
The following setting options are sometimes helpful when setting up successful communication with the remote system:
-b n Set Baud Rate − Specify the baud rate for the line given in the -l option, as in
kermit -l /dev/tty1p4 -b 9600
This option should always be included with the -l option, since the speed of an external line is not necessarily what you expect.
-p x Set Parity − e, o, m, s, n (even, odd, mark, space, or none). If parity is other than none, the 8th-bit prefixing mechanism is used for transferring 8-bit binary data, provided the opposite kermit agrees. The default parity is none.
-t Specifies half duplex, line turnaround with XON as the handshake character.
The following setting options can be used only with a kermit which is local — either by default or because the -l option has been specified:
-g rfn Actively request a remote server to send the named file or files; rfn is a file specification in the remote host’s own syntax. If rfn happens to contain any special shell characters, such as *, they must be quoted, as in:
kermit -g x\*.\?
-f Send a "finish" command to a remote server.
-c Establish a terminal connection over the specified or default communication line before any protocol transaction takes place. Control can be returned to the local system by typing the escape character (normally Control-Backslash) followed by the letter c.
-n Like -c, but connect after a protocol transaction takes place. -n and -c are used in the following manner:
Connect kermit through /dev/tty0p4 at 9600 baud:
kermit -l /dev/tty0p4 -b 9600 -c
Tell kermit to wait for a file to be received, then connect through /dev/tty0p4 at 9600 baud:
kermit -l /dev/tty0p4 -b 9600 -rn
On a timesharing system, the -l and -b options must also be included with the -r,-k, or -s options if the other kermit is on a remote system.
If kermit is in local mode, the standard output is continuously updated to show the progress of the file transfer. A dot (.) is printed for every four data packets; other packets are shown by type (e.g. S for Send-Init), T is printed when a timeout occurs, and % is printed for each retransmission. In addition, you can type certain “interrupt” commands during file transfer. These commands must be preceded by the escape character (by default, Ctrl-\).
Ctrl-F: Interrupt the current File, and go on to the next (if any).
Ctrl-B: Interrupt the entire Batch of files, terminate the transaction.
Ctrl-R: Resend the current packet
Ctrl-A: Display a status report for the current transaction.
Other Command-Line Options
Several other command-line options are provided:
-i Send or receive files exactly "as is" with no conversions. This option is necessary for transmitting binary files. It can also be used to slightly boost efficiency in HP-UX-to-HP-UX transfers of text files by eliminating CR-LF/newline conversion.
-w Write-Protect − Avoid filename collisions for incoming files.
-q Quiet − Suppress screen update during file transfer; for example to allow a file transfer to proceed in the background.
-d Debug − Record debugging information in the file debug.log in the current directory.
-h Help − Display a brief synopsis of the command line options.
Local vs. Remote Mode
kermit is “local” if it is running on a PC or workstation that you are using directly, or if it is running on a multiuser system and transferring files over an external communication line − not your job’s controlling terminal or console. kermit is remote if it is running on a multiuser system and transferring files over its own controlling terminal’s communication line connected to your PC or workstation.
If you are running kermit on a PC, it is in local mode by default, with the “back port” designated for file transfer and terminal connection. If you are running kermit on a multiuser (timesharing) system, it is in remote mode unless you explicitly point it at an external line for file transfer or terminal connection with the -l option.
Interactive operation
kermit’s interactive command prompt is "C-Kermit>". In response to this prompt, you can type any valid command. kermit executes the command then prompts you for another command. The process continues until you instruct the program to terminate.
Commands begin with a keyword, normally a verb, such as "send". You can omit trailing characters from any keyword, as long as you specify sufficient characters to distinguish it from any other keyword valid in that field. Certain commonly-used keywords (such as send, receive, connect) have special non-unique abbreviations (s for “send”, r for “receive”, c for “connect”).
Certain characters have special functions in interactive commands:
? Question mark, typed at any point in a command, produces a message explaining what is possible or expected at that point. Depending on the context, the message may be a brief phrase, a menu of keywords, or a list of files.
ESC (The Escape key) − Request completion of the current keyword or filename, or insertion of a default value. The result is a beep if the requested operation fails due to multiple matches.
DEL, BS (The Delete or Rubout key, Backspace or control-H) − Delete the previous character from the command.
^W (Control-W) − Erase the right-most word from the command line.
^U (Control-U) − Erase the entire command.
^R (Control-R) − Redisplay the current command.
SP, TAB (Space, Horizontal tab) − Delimits fields (keywords, filenames, numbers) within a command.
CR, LF, FF (Carriage Return, Line-feed, Form-feed) − Enters the command for execution.
\ (Backslash) − Enter any of the above characters into the command as a literal. To enter a backslash, type two backslashes in a row (\\).
You can type the editing characters ( DEL, ^W, etc.) repeatedly, to delete all the way back to the prompt. No action is performed until the command is entered by typing carriage-return, line-feed, or form-feed. If you make any mistakes , kermit displays an informative error message followed by a new prompt. Make liberal use of ? and ESC to feel your way through the commands. One important command is help − you should use it the first time you run kermit.
Interactive kermit accepts commands from files as well as from the keyboard. When you enter interactive mode, kermit looks for the file .kermrc in your home or current directory (first it looks in the home directory, then in the current one) and executes any commands it finds there. These commands must be in interactive format, not HP-UX command-line format. A take command is also provided to execute commands from a file at any time during an interactive session. Command files can be nested to any reasonable depth.
Here is a brief list of kermit interactive commands:
! command Execute the HP-UX shell command command.
bye Terminate and log out a remote kermit server.
close log_file Close a log file. log_file is one of the following: debugging, packets, session, or transactions.
connect Establish a terminal connection to a remote system as if it were a local terminal to that computer. The connection is made through the device specified in the most recent set line command. All characters you type at your keyboard are sent out the communication line, all characters arriving at the communication port are displayed on your terminal. Current settings of speed, parity, duplex, and flow control are honored. If you have issued a log session command, everything you see on your terminal is also recorded to your session log. This provides a way to “capture” files from systems that do not have kermit programs available.
To get back to your own system, type the escape character, which is FS (control-\, ASCII 28) unless you have changed it with the set escape command, followed by a single character command, such as c for “close connection”. The recognized single character commands are:
c Close the connection.
b Send a BREAK signal to remote machine.
0 (zero) Send a NUL character.
s Give a status report about the connection.
^e Send Ctrl-\ itself (or whatever you have defined the escape character to be, typed twice in a row sends one copy of it).
cwd dir Change Working Directory. Changes the current working directory to dir.
dial number Dial a telephone number. Tells the modem to dial the number num. kermit must be told what type of modem is being used (see set command below).
directory dir ...
Display a directory listing.
echo arg ... Display arguments literally.
exit Exit from the program, closing any open logs.
finish Instruct a remote kermit server to exit, but not log out.
get [file [dname]]
Get files from a remote kermit server. file may contain wildcard characters. If dname is specified, the first incoming file is stored under that name.
Since a remote file specification (or list) might contain spaces, which normally delimit fields of a kermit command, an alternate form of the command is provided to allow the inbound file to be given a new name: enter get alone on a line, and kermit prompts separately for the remote and local file specifications. For example:
C-Kermit> get
Remote file specification: foo
Local name to store it under: bar
help [topic] Display a help message for a given command.
log log_file file_name
Open a log file with name file_name. log_file must be one of the following: debugging, packet, session, or transaction.
quit Same as exit.
receive [dname]
Passively wait for files to arrive. If dname is specified, kermit stores the first incoming file under that name. The receive command may be abbreviated to r.
remote Issue file management commands to a remote kermit server. The valid remote commands are:
cwd dir Change remote working directory.
delete file ... Delete remote files.
directory dir ...
Display a listing of remote file names.
help [topic] Request help from a remote server.
host command Issue a command to the remote host in its own command language.
space Display current disk space usage on remote system.
type file Display a remote file on your screen.
who [user] Display who’s logged in, or get information about a user.
script text Log in on the remote system using the text provided. The login script is intended to operate similarly to UUCP Systems entries. A login script is a sequence of the form:
expect send [expect send] ...
where expect is a prompt or message to be issued by the remote site, and send is the data to return to the remote host. send can also be EOT to send Ctrl-D, or BREAK to send a break. Letters in send can be prefixed by ~ to send special characters. These are: ~b for backspace, ~s for space, ~q for “?”, ~n for linefeed, ~r for return, ~c for don’t append a return, and ~ooo (where ooo are octal digits) for the octal equivalent of a character. As with some UUCP systems, sent strings are followed by ~r unless they end with ~c.
Only the last seven characters in each expect are matched. A null expect, e.g., ~0 or two adjacent dashes, causes a short delay. If you expect that a sequence might not arrive, as with UUCP, conditional sequences can be expressed in the form:
−send-expect[−send-expect[...]]
where dashed sequences are followed as long as previous expects fail.
send file [dname]
Send files. Send the file of files specified by file to the other kermit, which should be running as a server, or which should be given the receive command. Each file is sent under its own name (or converted as specified by the set names command). The send command can be abbreviated to s even though s is not a unique abbreviation for a top-level kermit command.
The wildcard characters * and ? are accepted in file. If ? is to be included, it must be prefixed by \ to override its normal function of providing help. * matches any string; ? matches any single character. Other notations for file groups, such as [a-z]og, are not available in interactive commands. When file contains wildcard characters, there is a limit to the number of files that can be matched, which varies from system to system. If you get the message Too many files match , try again, using a more judicious selection.
kermit does not skip over "invisible" files that match the file specification. HP-UX systems usually treat files whose names start with a dot (such as .login, .profile, and .kermrc) as invisible.
If dname is specified, file must not contain any wildcard characters and dname specifies the name to send it under.
Note: kermit sends only from the current or specified directory. It does not traverse directory trees. If the source directory contains subdirectories, they are skipped. Conversely, kermit does not create directories when receiving files. If you need to do create directories, pipe tar(1) through kermit. For example, on the origination system, type:
tar cf - /usr/src | kermit -is -
This causes tar to send the directory /usr/src (and all files in its subdirectories) to standard output. kermit receives the standard input and sends it as a binary file. On the receiving system type:
kermit -il /dev/tty1p3 -b 9600 -k | tar xf -
This causes kermit to receive the tar archive and sends it via standard output to its own copy of tar, which extracts from it a replica of the original directory tree.
server Begin server operation. Places the local kermit into server mode. All further commands must arrive as valid kermit packets from the kermit on the other end of the line. The HP-UX kermit server can respond to the following commands:
get Send files.
send Receive files.
bye Attempt to log out.
finish Exit the server mode.
remote directory Send directory listing.
remote delete Remove files.
remote cwd Change working directory.
remote type Send files to your screen.
remote space Report about kermit disk usage.
remote who Shows who’s logged in.
remote host Executes an HP-UX shell command.
remote help Lists these capabilities.
set Set various parameters. The "set" parameters are:
block-check { 1 | 2 | 3 }
Level of packet error detection.
1 Single-character 6-bit checksum, folded to included the values of all bits from each character.
2 is a two-character 12-bit checksum.
3 Three-character 16-bit cyclic redundancy check (CRC).
The higher the block check, the better the error detection and correction and the higher the resulting overhead. Type 1 is most commonly used; it is supported by all kermit implementations, and has proven adequate in most circumstances. Types 2 or 3 would be used to advantage when transferring 8-bit binary files over noisy lines.
delay n How long to wait before sending first packet. n is specified in seconds.
duplex { full | half }
Specify which side echoes during "connect". full means the other side, half means the local kermit must echo typein itself.
escape-character cc
Character to prefix "escape commands" during "connect". The escape character is also used to prefix interrupt commands during file transfers. The default value is 28 (control backslash).
file param
Set various file parameters. Valid values for param are:
display { on | off }
Normally on. When in local mode, display progress of file transfers to the standard output, and listen to the standard input for interruptions. If off (also settable by -p on the kermit invocation line), none of this is done.
names { converted | literal }
Normally converted, which means that outbound file names have path specifications stripped, lowercase letters converted to uppercase, tildes and extra periods changed to Xs and an X inserted in front of any name that starts with period. Incoming files have uppercase letters shifted to lowercase. literal means none of these conversions are done. When using literal naming, the sender should not use path names in the file specification unless the same path exists on the target system and is writable.
type { binary | text }
Normally text, which means that conversion is done between HP-UX newline characters and the carriage-return/line-feed sequences required by the canonical kermit file transmission format, and in common use on non- HP-UX systems. binary means to transmit file contents without conversion. binary is necessary for binary file transmission and is desirable in all HP-UX -to- HP-UX transactions to cut down on overhead.
warning { on | off }
Normally off, which means that incoming files silently overwrite existing files of the same name. When on, kermit checks whether an arriving file would overwrite an existing file. If so, it constructs a new name for the arriving file of the form file~n, where file is the name they share and n is a generation number. For example if foo exists, the new file is called foo~1. If foo and foo~1 exist, the new file becomes foo~2, and so on.
flow-control { none | xon/xoff }
Communication line full-duplex flow control. Normally XON/XOFF for full duplex flow control. Should be set to none if the other system cannot do XON/XOFF flow control.
handshake { xon | xoff | cr | lf | bell | esc | none }
Normally none. Otherwise half duplex communication line turnaround handshaking is done, which means kermit does not reply to a packet until it has received the indicated handshake character or has timed out waiting for it.
line [device] Communication line device name. If you specify a device name, kermit operates in local mode and you should remember to issue any other necessary set commands, such as set speed. If you omit the device name, kermit reverts to its default mode of operation.
modem-dialer { direct | hayes | ventel }
Type of modem-dialer on communication line. direct indicates either there is no dial-out modem, or that if the line requires carrier detection to open, then set line hangs waiting for an incoming call. hayes and ventel indicate that the subsequent set line will prepare for a subsequent dial command for Hayes and Ventel dialers, respectively.
parity { even | odd | mark | space | none }
Communication line character parity. If other than none, kermit seeks to use the 8th-bit prefixing mechanism for transferring 8-bit binary data, which can be used successfully only if the other kermit agrees.
prompt [string]
Change the kermit program’s prompt. If string is given, the prompt is set to string. If string is omitted, the prompt reverts to the default C-Kermit>.
receive parameter value
Parameters to request or inspect for incoming packets, as follows:
end-of-line cc
Normally carriage return (15) by default.
packet-length number
Maximum length packet for the other side to send; a decimal number between 10 and 94. Shorter packet lengths can be used on noisy lines, or with systems, front ends, or networks that have small buffers. The shorter the packet, the higher the overhead, but the lower the chance of a packet being corrupted by noise, and the less time to retransmit the corrupted packets.
timeout number
How many seconds the other Kermit should wait for a packet before asking for retransmission.
pad-character cc
Character to use for inter-packet padding. Normally kermit does not need to have incoming packets preceded by pad characters. This command allows kermit to request the other kermit to use cc as a pad character. Default of NUL (ASCII 0). No kermits are known to need padding, and if one did, it would request it without your having to tell it to do so.
padding number
How many padding characters to request before each incoming packet.
start-of-packet cc
Set control character to mark beginning of incoming packets. The kermit packet prefix character is SOH (control-A). The only reasons it would ever be changed would be: Some piece of equipment somewhere between the two kermit programs cannot pass SOH, or some piece of equipment similarly placed is echoing its input. In the latter case, the recipient of such an echo can change the packet prefix for outbound packets, so that the echoed packets will be ignored. The opposite kermit must also be told to change the prefix for its inbound packets.
send parametervalue
Establish parameters for outgoing packets. This command is generally used to override negotiated values, or to establish values before negotiation takes place.
end-of-line cc
The ASCII character to be used as a line terminator for outbound packets if one is required by the other system. Normally carriage return (15) by default. This command is necessary only for systems requiring a line terminator other than carriage return.
packet-length number
Maximum length packet to send, decimal number, between 10 and 94, decimal. Shorter packet lengths can be used on noisy lines, or with systems, front ends, or networks that have small buffers. The shorter the packet, the higher the overhead, but the lower the chance of a packet being corrupted by noise, and the less time to retransmit the corrupted packets. This command can be used to specify a shorter length than the one requested by the other kermit, but not a longer one.
timeout number
How many seconds to wait for a packet before asking for trying again. A value of zero means do not time out (wait forever).
pad-character cc
Character to use for inter-packet padding. Default of NUL (ASCII 0).
padding number
How many padding characters to send before a packet. Defaults are no padding.
start-of-packet cc
Set control character to mark start of packets. The kermit packet prefix character is SOH (control-A). The only reasons it would ever be changed would be: Some piece of equipment somewhere between the two kermit programs does not pass SOH; or some piece of equipment similarly placed is echoing its input. The opposite kermit must also be told to change the prefix for its inbound packets.
speed { 0 | 110 | 300 | 600 | 1200 | 1800 | 2400 | 4800 | 9600 }
Set communication line speed. This command cannot be used to change the speed of your own console terminal. Normally, you must use this command after a set line before you can use the line.
show { parameters | versions }
In response to show parameters, kermit displays the current values of all set parameters described above. In response to show versions, kermit displays the version numbers and dates of all its interval modules.
space Display current disk space usage.
statistics Display statistics about most recent kermit protocol transaction including file and communication line I/O, as well as what encoding options were in effect (such as 8th-bit prefixing, repeat-count compression, etc.).
take file Execute commands from file. file can contain any interactive kermit commands, including take. Command files can be nested to any reasonable depth. The echo command can be used within command files to issue greetings, announce progress, etc.
Command files are in exactly the same syntax as interactive commands. Note that this implies that if you want to include special characters such as ? or \ you must quote these characters the same way as when typing interactive commands.
Command files can be used in lieu of command macros (which have not been implemented in this version of kermit). For example, if you commonly connect to a system called B that is connected to tty1p3 at 4800 baud, you could create a file called b containing the commands:
set line /dev/tty1p3
set speed 4800
echo Connecting to System B...
connect
then simply type take b (or t b since no other commands begin with the letter t) whenever you want to connect to system B.
An implicit take command is executed upon your .kermrc file upon kermit’s initial entry into interactive dialog. The .kermrc file should contain set or other commands you want to be in effect at all times. For instance, you might want to override the default action when incoming files have the same names as existing files. In that case, put the command
set file warning on
in your .kermrc file.
DIAGNOSTICS
The diagnostics produced by kermit itself are intended to be self-explanatory.
WARNINGS
File renaming: When filename collision avoidance (set file warning) is selected, kermit constructs unique names by appending a generation number to the end of the file name. Currently, no checking is done to ensure that the result is still within the maximum length for a file name. Consequently, if the existing file name is already the maximum allowable length, the file can be overwritten.
UUCP line locking: kermit locks lines when it first opens them, to prevent UUCP and multiuser conflicts. This occurs either when a set line is issued, or if the -l argument is used when the first dial, connect, or protocol operation occurs. The lock is released if another set line is issued, or if the program quits, exits, or is terminated by SIGINT. If a user connects and returns to the shell command level (for example to initiate kermit by piped commands) the line lock is released when returning to the shell. Locking is not needed or used if communication occur over the local terminal line (e.g. /dev/tty). In that case, there is no difficulty with piped operations releasing locks and lines.
Removing stale lock files: For various reasons, lock files sometimes get left after UUCP or kermit activities terminate. The most common reason is that the UUCP or kermit activity was killed by a shell command. UUCP supports a function called uuclean which is customarily used to remove these files after a predetermined age. If in doubt about a lock file on the dial-out line you need, contact your system administrator.
Modem controls: If a connection is made over a communication line (rather than on the controlling terminal line), and that line has modem controls (e.g. data terminal ready and carrier detect implementations), returning to the shell disconnects the conversation. In such cases, use interactive mode commands to avoid use of piped shell-level operations.
Resetting the terminal after abnormal termination of kill: When kermit terminates abnormally (such as when a kill command is issued by the operator − see kill(1)), it may be necessary to reset the terminal state. If commands do not seem to be accepted at the shell prompt, try typing ^J Reset ^J to take the terminal out of raw mode if it was stuck there.
AUTHOR
The kermit protocol was developed by Columbia University. kermit is available for many systems for a nominal fee from Columbia and various user groups.
FILES
/usr/bin/kermit
$HOME/.kermrc
SEE ALSO
Hewlett-Packard Company — HP-UX Release 9.0: August 1992