kermit (1) Linux Manual Page
NAME
kermit – C-Kermit 9.0: transport- and platform-independent interactive and scriptable communications software.
-
This document is intended to give the beginner sufficient information to make basic (if not advanced) use of C-Kermit 9.0. Although it might be rather long for a Unix manual page, it’s still far shorter than the C-Kermit manual, which should be consulted for advanced topics such as customization, character-sets, scripting, etc. We also attempt to provide a clear structural overview of C-Kermit’s many capabilities, functional areas, states, and modes and their interrelation, that should be helpful to beginners and veterans alike, as well as to those upgrading to version 9.0 from earlier releases.
This document is also available as a Web page at:
DESCRIPTION
C-Kermit is an all-purpose communications software package from the Kermit Project at Columbia University that:
•
Is portable to many platforms, Unix and non - Unix alike.
•
Can make both serial and network connections.
•
Can conduct interactive terminal sessions over its connection.
•
Can transfer text or binary files over the same connection.
•
Can convert character sets in the terminal session.
•
Can convert character sets during text - file file transfer.
•
Is customizable in every aspect of its operation.
C-Kermit is a modem program, a Telnet client, an Rlogin client, an FTP client, an HTTP client, and on selected platforms, also an X.25 client. It can make its own secure Internet connections using IETF-approved security methods including Kerberos IV, Kerberos V, SSL/TLS, and SRP and it can also make SSH connections through your external SSH client application. It can be the far-end file-transfer or client/server partner of your desktop Kermit client. It can also accept incoming dialed and network connections. It can even be installed as an Internet service on its own standard TCP socket, 1649 [RFC2839, RFC2840].
And perhaps most important, everything you can do "by hand" (interactively) with C-Kermit, can be "scripted" (automated) using its built-in cross-platform transport-independent script programming language, which happens to be identical to its interactive command language.
This manual page offers an overview of C-Kermit 9.0 for Unix ("Unix" is an operating system family that includes AIX, DG/UX, FreeBSD, HP-UX, IRIX, Linux, Mac OS X, NetBSD, OpenBSD, Open Server, Open Unix, QNX, Solaris, SunOS, System V R3, System V R4, Tru64 Unix, Unixware, Xenix, and many others). For thorough coverage, please consult the published C-Kermit manual and supplements (see DOCUMENTATION below). For further information about C-Kermit, Kermit software for other platforms, and Kermit manuals, visit the Kermit Project website:
This is a longer-than-average manual page, and yet it barely scratches the surface. Don’t be daunted. C-Kermit is a large and complex package, evolving over decades of practice and experience, but that doesn’t mean it’s hard to learn or use. Its most commonly used functions are explained here with pointers to additional information elsewhere.
SYNOPSIS
kermit [ filename ] [ options ] [ {=,–,+} text ] ]
or:
kermit URL
If the first command-line argument is the name of a file, interactive-mode commands are executed from the file. The ‘=’ (or "–") argument tells Kermit not to parse the remainder of the command line, but to make the words following ‘=’ available as \%1, \%2, … \%9. The "+" argument is like "=" but for use in "kerbang scripts" (explained below). A second command-line format allows the one and only argument to be a Telnet, FTP, HTTP, or IKSD URL.
Order of execution:
-
1. - The command file (if any).
- 2. The initialization file, if any, unless suppressed with -Y.
3. - The customization file (if it is executed by the initialization file).
4. - The command-line URL (if any, and if so, execution stops here).
5. - Command-line options (if any).
6. - Interactive commands.
Some command-line options can cause actions (such as -s to send a file); others just set parameters. If any action options are included on the command line, Kermit exits when finished unless also given the -S ("stay") option. If no action options are given, no initialization or command files contained an EXIT or QUIT command, and no fatal errors occurred, Kermit issues its prompt and waits for you to type commands.
- Bear in mind that C-Kermit can be built with selected features disabled, and also that certain features are not available on all platforms. For example, C-Kermit can’t be built with TCP/IP support on a platform that does not have TCP/IP header files and libraries (and even if Kermit does include TCP/IP support, it can’t be used to make TCP/IP connections on a computer that does not have a TCP/IP stack installed). If your version of C-Kermit lacks a feature mentioned here, use its SHOW FEATURES command to see what might have been excluded.
C-Kermit has three kinds of commands: regular single-letter command-line options, extended-format command-line options, and interactive commands.
Like most Unix commands, C-Kermit can be be given options on the command line. But C-Kermit also can be used interactively by giving it commands composed of words, which are more intuitive than cryptic command-line options, and more flexible too. In other words, you don’t have to use C-Kermit’s command-line options, but they are available if you want to. (By the same token, you don’t have to use its interactive commands either — you can use either or both in any combination.)
C-Kermit is generally installed in the PATH as "kermit", and therefore is invoked by typing the word "kermit" (lowercase) at the shell prompt, and then pressing the Return or Enter key. If you wish to include command-line options, put them after the word "kermit" but before pressing Return or Enter, separated by spaces, for example:
(‘$’ is the shell prompt; "kermit -s ckermit.tar.gz" is what you type, followed by Return or Enter.)
OPTIONS
Here is a list of C-Kermit’s single-letter command-line options, which start with a single dash (-), in ASCII ("alphabetical") order. Alphabetic case is significant (-A is not the same as -a). Action options are tagged "ACTION".
- -0
- (digit zero) 100% transparent Connect state for "in-the-middle" operation: 8 bits, no parity, no escape character, everything passes through.
- -8
- (digit eight) Connection is 8-bit clean (this is the default in C-Kermit 8.0 and later). Equivalent to the EIGHTBIT command, which in turn is a shortcut for SET TERMINAL BYTESIZE 8, SET COMMAND BYTESIZE 8, SET PARITY NONE.
- -9 arg
- (digit nine) Make a connection to an FTP server. Equivalent to the FTP OPEN command. Argument: IP-address-or-hostname[:optional-TCP-port]. NOTE: C-Kermit also has a separate FTP command-line personality, with regular FTP-like command-line syntax. More about this below.
- -A
- Kermit is to be started as an Internet service (IKSD) (only from inetd.conf).
- -B
- Kermit is running in Batch or Background (no controlling terminal). To be used in case Kermit doesn’t automatically sense its background status. Equivalent to the SET BACKGROUND ON command.
- -C arg
- Interactive-mode Commands to be executed. Argument: Commands separated by commas, list in doublequotes.
- -D arg
- Delay before starting to send in Remote mode. Equivalent to the SET DELAY command. Argument: Number of seconds.
- -E
- Exit automatically when connection closes. Equivalent to SET EXIT ON-DISCONNECT ON.
- -F arg
- Use an open TCP connection. Argument: Numeric file descriptor of open TCP connection. Also see: -j, -J.
- -G arg
- (ACTION) Get file(s) from server, send contents to standard output, which normally would be piped to another process. Argument: Remote file specification, in quotes if it contains metacharacters. Also see: -g, -k.
- -H
- Suppress program startup Herald and greeting.
- -I
- Tell Kermit it has a reliable connection, to force streaming to be used where it normally would not be. Equivalent to the SET RELIABLE ON command.
- -J arg
- (ACTION) "Be like Telnet." Like -j but implies -E. Argument: IP hostname/address optionally followed by service. NOTE: C-Kermit also has a separate Telnet command-line personality, with regular Telnet-like command-line syntax. More about this below.
- -L
- Recursive directory descent for files in -s option.
- -M arg
- My user name (for use with Telnet, Rlogin, FTP, etc). Equivalent to the SET LOGIN USER command. Argument: Username string.
- -O
- (ACTION) (Uppercase letter O) Be a server for One command only. Also see: -x.
- -P
- Don’t convert file (Path) names of transferred files. Equivalent to SET FILE NAMES LITERAL.
- -Q
- Quick Kermit protocol settings. Equivalent to the FAST command. This is the default in C-Kermit 7.0 and later.
- -R
- Remote-only (this just makes IF REMOTE true).
- -S
- Stay (enter command parser after action options).
- -T
- Force Text mode for file transfer; implies -V. Equivalent to SET TRANSFER MODE MANUAL, SET FILE TYPE TEXT.
- -V
- Disable automatic per-file text/binary switching. Equivalent to SET TRANSFER MODE MANUAL.
- -Y
- Skip (don’t execute) the initialization file.
- -a arg
- As-name for file(s) in -s, -r, or -g. Argument: As-name string (alternative filename). When receiving files, this can be a directory name.
- -b arg
- Speed for serial device. Equivalent to SET SPEED. Argument: Numeric Bits per second for serial connections.
- -c
- (ACTION) Enter Connect state before transferring files.
- -d
- Create a debug.log file with detailed debugging information (a second -d adds timestamps). Equivalent to LOG DEBUG but takes effect sooner.
- -e arg
- Maximum length for incoming Kermit file-transfer packets. Equivalent to SET RECEIVE PACKET-LENGTH. Argument: Length in bytes.
- -f
- (ACTION) Send a FINISH command to a Kermit server.
- -g arg
- Get file(s) from a Kermit server. Argument: File specification on other computer, in quotes if it contains metacharacters. Equivalent to GET. Also see: -a, -G, -r.
- -h
- (ACTION) Print Help text for single-letter command-line options (pipe thru ‘more’ to prevent scrolling).
- -i
- Force binary (Image) mode for file transfer; implies -V. Equivalent to SET TRANSFER MODE MANUAL, SET FILE TYPE BINARY.
- -j arg
- Make a TCP/IP connection. Argument: IP host name/address and optional service name or number. Equivalent to the TELNET command. Also see: -J, -F.
- -k
- (ACTION) Receive file(s) to standard output, which normally would be piped to another process. Also see: -r, -G.
- -l arg
- (Lowercase letter L) Make a connection on the given serial communications device. Equivalent to the SET LINE (SET PORT) command. Argument: Serial device name, e.g. /dev/ttyS0.
- -m arg
- Modem type for use with the -l device. Equivalent to the SET MODEM TYPE command. Argument: Modem name as in SET MODEM TYPE command, e.g. "usrobotics".
- -n
- (ACTION) Enter Connect state after transferring files (historical).
- -p arg
- Parity. Equivalent to the SET PARITY command. Argument: One of the following: e(ven), o(dd), m(ark), n(one), s(pace).
- -q
- Quiet (suppress most messages). Equivalent to SET QUIET ON.
- -r
- (ACTION) Receive file(s). Equivalent to the RECEIVE command. Argument: (none, but see -a)
- -s arg
- Send file(s). Argument: One or more local file specifications. Equivalent to the SEND command. Also see: -a.
- -t
- (Historical) Xon (Ctrl-Q) Turnaround character for half-duplex connections (used on serial linemode connections to old mainframes). Equivalent to SET DUPLEX HALF, SET HANDSHAKE XON.
- -v arg
- Window size for Kermit protocol (ignored when streaming). Equivalanet to SET WINDOW-SIZE. Argument: Number, 1 to 32.
- -w
- Incoming files Write over existing files. Equivalent to SET FILE COLLISION OVERWRITE.
- -x
- (ACTION) Enter server mode. Equivalent to the SERVER command. Also see: -O.
- -y arg
- Alternative initialization file. Argument: Filename.
- -z
- Force foreground behavior. To be used in case Kermit doesn’t automatically sense its foreground status. Equivalent to the SET BACKGROUND OFF command.
Extended command-line options (necessary because single-letter ones are about used up) start with two dashes (–), with words rather than single letters as option names. If an extended option takes an argument, it is separated from the option word by a colon (:). Extended options include:
-
–bannerfile:filename - File to display upon startup or IKSD login.
–cdfile:filename - File to be sent for display to the client when server changes directory (filename is relative to the changed-to directory).
–cdmessage:{on,off} - Enable/disable the server CD message feature.
–help - Prints usage message for extended options.
–helpfile:filename - Designates a file containing custom text to replace the top-level HELP command.
–nointerrupts - Disables keyboard interrupts.
–noperms - Disables the Kermit protocol file Permissions attribute, to prevent transmission of file permissions (protection) from sender to receiver.
–version - (ACTION) C-Kermit prints its version number.
Plus several other IKSD-Only options described at:
See the file-transfer section for examples of command-line invocation.
COMMAND LANGUAGE
C-Kermit’s interactive command language is the subject of a 622-page book and another several hundred pages of updates, far too much for a manual page. But it’s not hard to get started. At the shell prompt, just type "kermit" to get C-Kermit’s interactive command prompt:
$ kermit (/current/directory) C-Kermit>
Begin by typing "help" (and then press the Return or Enter key) for a top-level overview, read it, and go from there. Your second command should probably be "intro" (introduction). Note the prompt shows your current directory (unless you tell Kermit to prompt you with something else).
Interactive commands are composed mainly of regular English words, usually in the form of imperative sentences, such as:
which tells Kermit to send (transfer) the file whose name is oofa.txt, or:
which sets Kermit’s "transfer mode" to "automatic" (whatever that means).
While typing commands, you can abbreviate, ask for help (by pressing the "?" key anywhere in a command), complete keywords or filenames (with the Tab or Esc key), and edit your typing with Backspace or Delete, Ctrl-W, Ctrl-U, etc. You can also recall previous commands, save your command history, and who knows what else. Give the INTRO command for details.
C-Kermit has hundreds of commands, and they can be issued in infinite variety and combinations, including commands for:
•
Making connections(SET LINE, DIAL, TELNET, SSH, FTP, …)
& bull;
Breaking connections(HANGUP, CLOSE)
& bull;
Transferring files(SEND, GET, RECEIVE, MOVE, RESEND, …)
& bull;
Establishing preferences(SET)
& bull;
Displaying preferences(SHOW)
& bull;
Managing local files(CD, DELETE, MKDIR, DIR, RENAME, TYPE, …)
& bull;
Managing remote files(RCD, RDEL, RMKDIR, RDIR, …)
& bull;
Using local files(FOPEN, FCLOSE, FREAD, FWRITE)
& bull;
Programming(TAKE, DEFINE, IF, FOR, WHILE, SWITCH, DECLARE, …)
& bull;
Interacting with the user(ECHO, ASK, …)
& bull;
Interacting with a remote computer(INPUT, OUTPUT, …)
& bull;
Interacting with local programs(RUN, EXEC, PTY, …)
& bull;
Logging things(LOG SESSION, LOG PACKETS, LOG DEBUG, …)
And of course QUIT or EXIT to get out and HELP to get help, and for programmers: loops, decision making, variables, arrays, associative arrays, integer and floating point arithmetic, macros, built-in and user-defined functions, string manipulation, pattern matching, block structure, scoping, recursion, and all the rest. To get a list of all C-Kermit’s commands, type a question mark (?) at the prompt. To get a description of any command, type HELP followed by the name of the command, for example:
The command interruption character is Ctrl-C (hold down the Ctrl key and press the C key).
The command language "escape character", used to introduce variable names, function invocations, and so on, is backslash (). If you need to include a literal backslash in a command, type two of them, e.g.:
Command Files, Macros, and Scripts
A file containing Kermit commands is called a Kermit command file or Kermit script. It can be executed with Kermit’s TAKE command:
(where "commandfile" is the name of the command file). Please don’t pipe a command file into Kermit’s standard input (which might or might not work); if you have Kermit commands in a file, tell Kermit to TAKE the file.
In Unix only, a Kermit command file can also be executed directly by including a "kerbang" line as the first line of the file:
That is, a top line that starts with "#!", followed immediately by the full path of the Kermit executable, and then, if the Kermit script is to be given arguments on the command line, a space and a plus sign. The script file must also have execute permission:
Except for the " +" part, this is exactly the same as you would do for a shell script, a Perl script, etc. Here’s a simple but useless example script that regurgitates its arguments (up to three of them):
If this file is stored in your current directory as "commandfile", then:
prints:
This illustrates the basic structure of a standalone Kermit script: the "kerbang line", then some commands. It should end with "exit" unless you want the Kermit prompt to appear when it is finished. \%1 is the first argument, \%2 the second, and so on.
You can also create your own commands by defining named macros composed of other Kermit commands (or macros). For example:
define mydelete
{
local trash
assign trash (home) trashcan /
if not defined \% 1 end 1 “Delete what?” if wild \% 1
{
end 1 “Deleting multiple files is too scary”
}
if
not exist \% 1 end 1 “I can’t find \%1” if not directory \m(trash)
{
mkdir \m(trash) if fail end 1 “No trash can”
}
rename / list \% 1 \m(trash)
}
define myundelete
{
local trash
assign trash (home) trashcan /
if not defined \% 1 end 1 “Undelete what?” if wild \% 1
{
end 1 “Undeleting multiple files is too hard”
}
if
not directory \m(trash) end 1 “No trash can” if not exist \m(trash)\% 1 {end 1 “I can’t find \%1 in trash can”} rename / list \m(trash)\% 1.
}
These sample macros are not exactly production quality (they don’t handle filenames that include path segments, they don’t handle multiple files, etc), but you get the idea: you can pass arguments to macros, and they can check them and make other kinds of decisions. If you put the above lines into your initialization or customization file (explained below), you’ll have MYDELETE and MYUNDELETE commands available every time you start Kermit, at least as long as you don’t suppress execution of the initialization file. (Exercise for the reader: Make these macros generally useful: remove limitations, add trashcan display, browsing, emptying, etc.)
Kerbang scripts execute without the initialization file. This to keep them portable and also to make them start faster. If you want to write Kerbang scripts that depend on the initialization file, include the command
at the desired spot in the script. By the way, (xxx) is a built-in variable (xxx is the variable name, "home" in this case). To see what built-in variables are available, type "show variables" at the C-Kermit prompt. To see what else you can show, type "show ?". \m(xxx) is a user defined variable (strictly speaking, it is a macro used as a variable).
Command List
C-Kermit has more than 200 top-level commands, and some of these, such as SET, branch off into hundreds of subcommands of their own, so it’s not practical to describe them all here. Instead, here’s a concise list of the most commonly used top-level commands, grouped by category. To learn about each command, type "help" followed by the command name, e.g. "help set". Terms such as Command state and Connect state are explained in subsequent sections.
Optional fields are shown in [ brackets ]. "filename" means the name of a single file. filespec means a file specification that is allowed to contain wildcard characters like ‘*’ to match groups of files. options are (optional) switches like /PAGE, /NOPAGE, /QUIET, etc, listed in the HELP text for each command. Example:
send /recursive /larger:10000 /after:-1week /except:*.txt *
which can be read as "send all the files in this directory and all the ones underneath it that are larger than 10000 bytes, no more than one week old, and whose names don’t end with ".txt".
Basic Commands
-
- HELP
- Requests top-level help.
- HELP command
- Requests help about the given command.
- INTRODUCTION
- Requests a brief introduction to C-Kermit.
- LICENSE
- Displays the C-Kermit software copyright and license.
- VERSION
- Displays C-Kermit’s version number.
- EXIT [ number ]
- Exits from Kermit with the given status code. Synonyms: QUIT, E, Q.
- TAKE filename [ parameters… ]
- Executes commands from the given
- LOG item [ filename ]
- Keeps a log of the given item in the given file.
- [ DO ] macro [ parameters… ]
- Executes commands from the given macro.
- SET parameter value
- Sets the given parameter to the given value.
- SHOW category
- Shows settings in a given category.
- STATUS
- Tells whether previous command succeeded or failed.
- DATE [ date-and/or-time ]
- Shows current date-time or interprets given date-time.
- RUN [ extern-command [ parameters… ]
- Runs the given external command. Synonym: !.
- EXEC [ extern-command [ params… ]
- Kermit overlays itself with the given command.
- SUSPEND
- Stops Kermit and puts it in the background. Synonym: Z.
Local File Management
-
- TYPE [ options ] filename
- Displays the contents of the given file.
- MORE [ options ] filename
- Equivalent to TYPE /PAGE (pause after each screenful).
- CAT [ options ] filename
- Equivalent to TYPE /NOPAGE.
- HEAD [ options ] filename
- Displays the first few lines of a given file.
- TAIL [ options ] filename
- Displays the last few lines of a given file.
- GREP [ options ] pattern filespec
- Displays lines from files that match the pattern. Synonym: FIND.
- DIRECTORY [ options ] [filespec ]
- Lists files (built-in, many options).
- LS [ options ] [ filespec ]
- Lists files (runs external "ls" command).
- DELETE [ options ] [ filespec ]
- Deletes files. Synonym: RM.
- PURGE [ options ] [ filespec ]
- Removes backup (*.~n~) files.
- COPY [ options ] [ filespecs… ]
- Copies files. Synonym: CP.
- RENAME [ options ] [ filespecs… ]
- Renames files. Synonym: MV.
- CHMOD [ options ] [ filespecs… ]
- Changes permissions of files.
- TRANSLATE filename charsets [ filename ]
- Converts file’s character set. Synonym: XLATE.
- CD
- Changes your working directory to your home directory.
- CD directory
- Changes your working directory to the one given.
- CDUP
- Changes your working directory one level up.
- PWD
- Displays your working directory.
- BACK
- Returns to your previous working directory.
- MKDIR [ directory ]
- Creates a directory.
- RMDIR [ directory ]
- Removes a directory.
Making Connections
-
- SET LINE [ options ] devicename
- Opens the named serial port. Synonym: SET PORT.
- OPEN LINE [ options ] devicename
- Same as SET LINE. Synonym: OPEN PORT.
- SET MODEM TYPE [ name ]
- Tells Kermit what kind of modem is on the port.
- DIAL [ number ]
- Tells Kermit to dial the given phone number with the modem.
- REDIAL
- Redials the most recently dialed phone number.
- ANSWER
- Waits for and answers an incoming call on the modem.
- AUTHENTICATE [ parameters… ]
- Performs secure authentication on a TCP/IP connection.
- SET NETWORK TYPE { TCP/IP, X.25, … }
- Selects network type for subsequent SET HOST commands.
- SET HOST [ options ] host [ port ]
- Opens a network connection to the given host and port.
- SET HOST * port
- Waits for an incoming TCP/IP connection on the given port.
- TELNET [ options ] host
- Opens a Telnet connection to the host and enters Connect state.
- RLOGIN [ options ] host
- Opens an Rlogin connection to the host and enters Connect state.
- IKSD [ options ] host
- Opens a connection to an Internet Kermit Service.
- SSH [ options ] host
- Opens an SSH connection to the host and enters Connect state.
- FTP OPEN host [ options ]
- Opens an FTP connection to the host.
- HTTP [ options ] OPEN host
- Opens an HTTP connection to the host.
- PTY external-command
- Runs the command on a pseudoterminal as if it were a connection.
- PIPE external-command
- Runs the command through a pipe as if it were a connection.
Using Connections
-
- CONNECT [ options ]
- Enters Connect (terminal) state. Synonym: C.
- REDIRECT command
- Redirects the given external command over the connection.
- TELOPT command
- Sends a Telnet protocol command (Telnet connections only).
- Ctrl-\C
- "Escapes back" from Connect state to Command state.
- Ctrl-\B
- (In Connect state) Sends a BREAK signal (serial or Telnet).
- Ctrl-\!
- (In Connect state) Enters inferior shell; "exit" to return.
- Ctrl-\?
- (In Connect state) Shows a menu of other escape-level options.
- Ctrl-\Ctrl-\
- (In Connect state) Type two Ctrl-Backslashes to send one of them.
- SET ESCAPE [ character ]
- Changes Kermit’s Connect-state escape character.
Closing Connections
-
- HANGUP
- Hangs up the currently open serial-port or network connection.
- CLOSE
- Closes the currently open serial-port or network connection.
- SET LINE (with no devicename)
- Closes the currently open serial-port or network connection.
- SET HOST (with no hostname)
- Closes the currently open serial-port or network connection.
- FTP CLOSE
- Closes the currently open FTP connection.
- HTTP CLOSE
- Closes the currently open HTTP connection.
- EXIT
- Also closes all connections. Synonym: QUIT.
- SET EXIT WARNING OFF
- Suppresses warning about open connections on exit or close.
File Transfer
-
- SEND [ options ] filename [ as-name ]
- Sends the given file. Synonym: S.
- SEND [ options ] filespec
- Sends all files that match.
- RESEND [ options ] filespec
- Resumes an interrupted SEND from the point of failure.
- RECEIVE [ options ] [ as-name ]
- Waits passively for files to arrive. Synonym: R.
- LOG TRANSACTIONS [ filename ]
- Keeps a record of file transfers.
- FAST
- Use fast file-transfer settings (default).
- CAUTIOUS
- Use cautious and less fast file-transfer settings.
- ROBUST
- Use ultra-conservative and slow file-transfer settings.
- STATISTICS [ options ]
- Gives statistics about the most recent file transfer.
- WHERE
- After transfer: "Where did my files go?".
- TRANSMIT [ options ] [ofilename ]
- Sends file without protocol. Synonym: XMIT.
- LOG SESSION [ filename ]
- Captures remote text or files without protocol.
- SET PROTOCOL [ name… ]
- Tells Kermit to use an external file-transfer protocol.
- FTP { PUT, MPUT, GET, MGET, … }
- FTP client commands.
- HTTP { PUT, GET, HEAD, POST, … }
- HTTP client commands.
Kermit Server
-
- ENABLE, DISABLE
- Controls which server features can be used by clients.
- SET SERVER
- Sets parameters prior to entering Server state.
- SERVER
- Enters Server state.
Client of Kermit or FTP Server
-
- [ REMOTE ] LOGIN [ user password ]
- Logs in to a Kermit server or IKSD that requires it.
- [ REMOTE ] LOGOUT
- Logs out from a Kermit server or IKSD.
- SEND [ options ] filename [ as-name ]
- Sends the given file to the server. Synonyms: S, PUT.
- SEND [ options ] filespec
- Sends all files that match.
- RESEND [ options ] filespec
- Resumes an interrupted SEND from the point of failure.
- GET [ options ] remote-filespec
- Asks the server to send the given files. Synonym: G.
- REGET [ options ] remote-filespec
- Resumes an interrupted GET from the point of failure.
- REMOTE CD [ directory ]
- Asks server to change its working directory. Synonym: RCD.
- REMOTE PWD [ directory ]
- Asks server to display its working directory. Synonym: RPWD.
- REMOTE DIRECTORY [ filespec… ]
- Asks server to send a directory listing. Synonym: RDIR.
- REMOTE DELETE [ filespec… ]
- Asks server to delete files. Synonym: RDEL.
- REMOTE [ command… ]
- (Many other commands: "remote ?" for a list).
- MAIL [ options ] filespec
- Sends file(s) to be delivered as e-mail (Kermit only).
- FINISH
- Asks the server to exit server state (Kermit only).
- BYE
- Asks the server to log out and close the connection.
Script Programming
- DEFINE, DECLARE, UNDEFINE, UNDECLARE, ASSIGN, EVALUATE, SEXPRESSION, ARRAY, SORT, INPUT, OUTPUT, IF, FOR, WHILE, SWITCH, GOTO, ECHO, ASK, GETC, GETOK, ASSERT, WAIT, SLEEP, FOPEN, FREAD, FWRITE, FCLOSE, STOP, END, RETURN, LEARN, SHIFT, TRACE, VOID, INCREMENT, DECREMENT, … For these and many more you’ll need to consult the manual and supplements, and/or visit the Kermit Script Library, which also includes a brief tutorial. Hint: HELP LEARN to find out how to get Kermit to write simple scripts for you.
Many of Kermit’s commands have synonyms, variants, relatives, and so on. For example, MSEND is a version of SEND that accepts a list of file specifications to be sent, rather than just one file specification, and MPUT is a synonym of MSEND. MOVE means to SEND and then DELETE the source file if successful. MMOVE is like MOVE, but accepts a list of filespecs, and so on. These are described in the full documentation.
Use question mark to feel your way through an unfamiliar command, as in this example:
C-Kermit> remote ? One of the following: assign directory kermit print rmdir cd exit login pwd set copy help logout query space delete host mkdir rename type C-Kermit> remote set ? One of the following: attributes file retry transfer block-check receive server window C-Kermit> remote set file ? One of the following: character-set incomplete record-length collision names type C-Kermit> remote set file names ? One of the following: converted literal C-Kermit> remote set file names literal C-Kermit>
This is called menu on demand: you get a menu when you want one, but menus are not forced on you even when know what you’re doing. Note that you can also abbreviate most keywords, and you can complete them with the Tab or Esc key. Also note that ? works for filenames too, and that you can use it in the middle of a keyword or filename, not just at the beginning. For example, "send x?" lists all the files in the current directory whose names start with ‘x’.
INITIALIZATION FILE
In its default configuration, C-Kermit executes commands from a file called .kermrc in your home directory when it starts, unless it is given the -Y or -y command-line option. Custom configurations might substitute a shared system-wide initialization file. The SHOW FILE command tells what initialization file, if any, was used. The standard initialization file "chains" to an individual customization file, .mykermc, in the home directory, in which each user can establish her/his own preferences, define macros, and so on.
Since execution of the initialization file (at least the standard one) makes C-Kermit take longer to start, it might be better not to have an initialization file, especially now that Kermit’s default startup configuration is well attuned to modern computing and networking — in other words, you no longer have do anything special to make Kermit transfers go fast. So instead of having an initialization file that is executed every time Kermit starts, you might consider making one or more kerbang scripts (with names other that .kermrc) that do NOT include an "exit" command, and invoke those when you need the settings, macro definitions, and/or scripted actions they contain, and invoke C-Kermit directly when you don’t.
To put it another way… We still distribute the standard initialization file since it’s featured in the manual and backwards compatibility is important to us. But there’s no harm in not using it if you don’t need the stuff that’s in it (services directory, dialing directory, network directory, and associated macro definitions). On the other hand, if there are settings or macros you want in effect EVERY time you use Kermit, the initialization file (or the customization file it chains to) is the place to put them, because that’s the only place Kermit looks for them automatically each time you start it.
MODES OF OPERATION
Kermit is said to be in Local mode if it has made a connection to another computer, e.g. by dialing it or establishing a Telnet connection to it. The other computer is remote, so if you start another copy of Kermit on the remote computer, it is said to be in Remote mode (as long as it has not made any connections of its own). The local Kermit communicates over the communications device or network connection, acting as a conduit between the the remote computer and your keyboard and screen. The remote Kermit is the file-transfer partner to the local Kermit and communicates only through its standard input and output.
At any moment, a Kermit program can be in any of the following states. It’s important to know what they are and how to change from one to the other.
- Command state
- In this state, Kermit reads commands from:
•
Your keyboard; or:•
A file, or:•
A macro definition.You can exit from Command state back to Unix with the EXIT or QUIT command (same thing). You can enter Connect state with any of various commands (CONNECT, DIAL, TELNET, etc). You can enter file transfer state with commands like SEND, RECEIVE, and GET. You can enter Server state with the SERVER command. The TAKE command tells Kermit to read and execute commands from a file. The (perhaps implied) DO command tells Kermit to read and execute commands from a macro definition. While in Command state, you can interrupt any command, macro, or command file by typing Ctrl-C (hold down the Ctrl key and press the C key); this normally brings you back to the prompt.
- Shell state
- You can invoke an inferior shell or external command from the Kermit command prompt by using the PUSH, RUN (!), EDIT, or BROWSE command. While the inferior shell or command is active, Kermit is suspended and does nothing. Return to Kermit Command state by exiting from the inferior shell or application.
- Connect state
- In this state, which can be entered only when in Local mode (i.e. when Kermit has made a connection to another computer), Kermit is acting as a terminal to the remote computer. Your keystrokes are sent to the remote computer and characters that arrive over the communication connection are displayed on your screen. This state is entered when you give a CONNECT, DIAL, TELNET, RLOGIN, or IKSD command. You can return to command state by logging out of the remote computer, or by typing:
Ctrl-
