![]() |
![]()
| ![]() |
![]()
NAMEkermit - C‐Kermit 10.0: transport‐ and platform‐independent interactive and scriptable communications software.
This document is also available as a Web page at:
DESCRIPTIONC‐Kermit is an all‐purpose communications software package originally from the Kermit Project at Columbia University and now from the independent Open Source Kermit Project that: • Is portable to many platforms, Unix and non‐Unix alike. C‐Kermit is a modem program, a Telnet client, an SSH 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 10.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. SYNOPSISkermit [ 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:
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.
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 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.) OPTIONSHere 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".
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:
Plus several other IKSD‐Only options described at:
See the file‐transfer section for examples of command‐line invocation. COMMAND LANGUAGEC‐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:
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 somefile.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, ...)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 even a built-in LISP regular expression interpreter. 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 ScriptsA 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). 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: 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, \v(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 ListC‐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:
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
Local File Management
Making Connections
Using Connections
Closing Connections
File Transfer
Kermit Server
Client of Kermit or FTP Server
Script ProgrammingDEFINE, 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: 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 FILEIn 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. MODES OF OPERATIONKermit 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 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.
MAKING CONNECTIONSHere is how to make different kinds of connections using interactive Kermit commands (as noted above, you can also make connections with command‐line options). Note that you don't have to make connections with Kermit. It can also be used on the far end of a connection as the remote file transfer and management partner of your local communications software.
With modems or direct serial connections, you might also have to "set parity even" (or "mark" or "space") if it's a 7‐bit connection. Of the connection types listed above, only one can be open at a time. However, any one of these can be open concurrently with an FTP or HTTP session. Each connection type can be customized to any desired degree, scripted, logged, you name it. See the manual. NOTE: On selected platforms, C‐Kermit also can make X.25 connections. See the manual for details. TRANSFERRING FILES WITH KERMITThere is a widespread and persistent belief that Kermit is a slow protocol. This is because, until recently, it used conservative tuning by default to make sure file transfers succeeded, rather than failing because they overloaded the connection. Some extra commands (or command‐line options, like -Q) were needed to make it go fast, but nobody bothered to find out about them. Also, it takes two to tango: most non‐Kermit‐Project Kermit protocol implementations really ARE slow. The best file‐transfer partners for C‐Kermit are: another copy of C‐Kermit (7.0 or later) on Unix, (Open)VMS, or Microsoft Windows (formerly known as Kermit 95 or K95, now in Open Source release as C-Kermit 10.0 for Windows or CKW). These combinations work well and they work fast by default. MS‐DOS Kermit is good too, but you have to tell it to go fast (by giving it the FAST command). Furthermore, all three of these Kermit programs support "autodownload" and "autoupload", meaning that when they are in Connect state and a Kermit packet comes in from the remote, they automatically switch into file transfer mode. And plus, C‐Kermit switches automatically between text and binary mode for each file, so there is no need to "set file type binary" or "set file type text", or to worry about files being corrupted because they were transferred in the wrong mode. What all of these words add up to is that now, when you use up‐to‐date Kermit software from the Kermit Project, file transfer is not only fast, it's ridiculously easy. You barely have to give any commands at all. Downloading FilesLet's say you have C‐Kermit for Unix or VMS, CKW for Windows, or MS‐DOS Kermit on your desktop computer, with a connection to a Unix computer that has C‐Kermit installed as "kermit". To download a file (send it from Unix to your desktop computer), just type the following command at your Unix shell prompt:
(where somefile.txt is the filename). If you want to send more than one file, you can put as many filenames as you want on the command line, and they can be any combination of text and binary:
and/or you can use wildcards to send groups of files:
If you want to send a file under an assumed name, use:
This sends the file friday.txt but tells the receiving Kermit that its name is today.txt. In all cases, as noted, when the file transfer is finished, your desktop Kermit returns automatically to Connect state. No worries about escaping back, re‐connecting, text/binary mode switching. Almost too easy, right? Uploading FilesTo upload files (send them from your desktop computer to the remote Unix computer) do the same thing, but use the -g (GET) option instead of -s:
This causes your local Kermit to enter server mode; then the remote Kermit program requests the named file and the local Kermit sends it and returns automatically to Connect state when done. If you want to upload multiple files, you have to use shell quoting rules, since these aren't local files:
If you want to upload a file but store it under a different name, use:
Kermit Transfers the Old‐Fashioned WayIf your desktop communications software does not support autoupload or autodownload, or it does not include Kermit server mode, the procedure requires more steps. To download a file, type:
on the host as before, but if nothing happens automatically in response to this command, you have to switch your desktop communications software into Kermit Receive state. This might be done by escaping back using keyboard characters or hot keys (Alt-x is typical) and/or with a command (like RECEIVE) or a menu. When the file transfer is complete, you have to go back to Connect state, Terminal emulation, or whatever terminology applies to your desktop communications software. To upload a file, type:
on the host (rather than "kermit -g"). This tells C‐Kermit to wait passively for a file to start arriving. Then regain the attention of your desktop software (Alt-x or whatever) and instruct it to send the desired file(s) with Kermit protocol. When the transfer is finished, return to the Connect or Terminal screen. If File Transfer FailsAlthough every aspect of Kermit's operation can be finely tuned, there are also three short and simple "omnibus tuning" commands you can use for troubleshooting:
Obviously the success and performance of a file transfer also depends on C‐Kermit's file transfer partner. Up‐to‐date, real Kermit Project partners are recommended because they contain the best Kermit protocol implementations and because we can support them in case of trouble. If you still have trouble, consult Chapter 10 of Using C‐Kermit, or send email to upport@kermitproject.org. Advanced Kermit File‐Transfer FeaturesObviously there is a lot more to Kermit file transfer, including all sorts of interactive commands, preferences, options, logging, debugging, troubleshooting, and anything else you can imagine but that's what the manual and updates are for. Here are a few topics you can explore if you're interested by Typing HELP for the listed commands:
Non‐Kermit File TransferYou can also use C‐Kermit to transfer files with FTP or HTTP Internet protocols; see below. On a regular serial or Telnet connection where the other computer doesn't support Kermit protocol at all, you have several options. For example, if your desktop communications software supports Zmodem, use "rz" and "sz" on the host rather than Kermit. But if Kermit is your desktop software, and you are using it to make calls or network connections to other computers that don't support Kermit protocol (or that don't have a good implementation of it), then if your computer also has external X, Y, or Zmodem programs that are redirectable, Kermit can use them as external protocols. HELP SET PROTOCOL for details. You can also capture "raw" data streams from the other computer with LOG SESSION (HELP LOG and HELP SET SESSION-LOG for details), and you can upload files without any protocol at all with TRANSMIT (HELP TRANSMIT, HELP SET TRANSMIT). KERMIT'S BUILT‐IN FTP AND HTTP CLIENTSKermit's FTP client is like the regular Unix FTP client that you're used to, but with some differences:
The Kermit FTP client is thoroughly documented at the Kermit Project website:
You also can use HELP FTP and HELP SET FTP to get descriptions of Kermit's FTP‐related commands. The HTTP client is similar to the FTP one, except you prefix each command with HTTP instead of FTP: HTTP OPEN, HTTP GET, HTTP PUT, HTTP CLOSE, etc. Type HELP HTTP for details, or visit the to view the manual supplements. HTTP connections can be open at the same time as regular serial or Telnet connections and FTP connections. So Kermit can manage up to three types connections simultaneously. INTERNET KERMIT SERVICEC‐Kermit can be configured and run as an Internet service (called IKSD), similar to an FTP server (FTPD) except you can (but need not) interact with it directly, plus it does a lot more than an FTP server can do. The TCP port for IKSD is 1649. It uses Telnet protocol. C‐Kermit can be an Internet Kermit Server, or it can be a client of an IKSD. You can make connections from C‐Kermit to an IKSD with any of the following commands:
The IKSD command is equivalent to a TELNET command specifying port 1649. For more information about making and using connections to an IKSD, see:
You can run an Internet Kermit Service on your own computer too (if you are the system administrator). For instructions, see:
SECURITYAll of C‐Kermit's built‐in TCP/IP networking methods (Telnet, Rlogin, IKSD, FTP, and HTTP) can be secured by one or more of the following IETF‐approved methods: • MIT Kerberos IV
The Windows version of C-Kermit 10.0 (CKW) has its own built-in SSH client; the Unix version makes SSH connections through the external SSH client. For complete instructions see:
ALTERNATIVE COMMAND‐LINE PERSONALITIESWhen invoked as "kermit" or any other name besides "ftp" or "telnet", C‐Kermit has the command‐line options described above in the OPTIONS section. However, if you invoke C‐Kermit as "telnet" or "ftp", it changes its command‐line personality to match. This can be done (among other ways) with symbolic links (symlinks). For example, if you want C‐Kermit to be your regular Telnet client, or the Telnet helper of your Web browser, you can create a link like the following in a directory that lies in your PATH ahead of the regular telnet program:
Now when you give a "telnet" command, you are invoking Kermit instead, but with its Telnet command‐line personality so, for example:
Makes a Telnet connection to xyzcorp.com, and Kermit exits automatically when the connection is closed (just like the regular Telnet client). Type "telnet -h" to get a list of Kermit's Telnet‐personality command‐line options, which are intended to be as compatible as possible with the regular Telnet client. Similarly for FTP:
And now type "ftp -h" to see its command‐line options, and command lines just like you would give your regular FTP client:
but with additional options allowing an entire session to be specified on the command line. Finally, if Kermit's first command‐line option is a Telnet, FTP, IKSD, or HTTP URL, Kermit automatically makes the appropriate kind of connection and, if indicated by the URL, takes the desired action:
LICENSEAs of version 9.0 C‐Kermit carries the Revised 3-Clause BSD License, which is 100% Open Source. C-Kermit's LICENSE command displays the license, and it is also available on the Kermit Project website: OTHER TOPICSThere's way more to C‐Kermit than we've touched on here ‐‐ troubleshooting, customization, character sets, dialing directories, sending pages, script writing, and on and on, all of which are covered in the manual and updates and supplements. For the most up‐to‐date information on documentation (or updated documentation itself) visit the Kermit Project website:
There you will also find Kermit software packages for other platforms: different Unix varieties, Windows, DOS, VMS, IBM mainframes, and many others: over 40 years' worth at this writing (2022). DOCUMENTATION AND UPDATESThe manual for C‐Kermit is:
Visit the C‐Kermit home page:
to learn about new versions, Beta tests, and other news; to read case studies and tutorials; to download source code, install packages, and prebuilt binaries for many platforms. Also visit:
AUTHORS
|