Path: utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!bingvaxu!leah!emb978 From: emb978@leah.Albany.Edu ( Eric M. Boehm) Newsgroups: comp.sys.ibm.pc Subject: Re: Request for Kermit 2.30. Summary: Docs for Kermit-MS 2.30, Part 2 of 6 Message-ID: <575@leah.Albany.Edu> Date: 23 Jan 88 21:48:36 GMT References: <20064@amdcad.AMD.COM> <574@leah.Albany.Edu> Organization: The University at Albany, Computer Services Center Lines: 995 ------------------------------------------------------------------------------- set port 2 ; Select the modem port. set speed 1200 ; Set the baud rate for the modem. connect ; Conduct a terminal session. hangup ; Hang up the phone after escaping back. Note the HANGUP command after CONNECT. The HANGUP command is not executed un- til after you escape back from your CONNECT session. If this file were called MODEM.CMD, the following TAKE command would execute it: Kermit-MS>take modem.cmd This directs MS-Kermit to find the MODEM.CMD file, open it, execute the com- mands in it, close it, and return to the MS-Kermit> prompt when done. This process can take a while on floppy-disk based systems. Commands from the TAKE file will normally not be displayed on your screen during execution. If you want to see them as they are executing, you can SET TAKE-ECHO ON (for instance, at the beginning or end of your MSKERMIT.INI file). With the echoing ON, comments are also displayed for reference, but the semi- colon is not shown. TAKE files may be nested to any reasonable level. A command file that was in- voked by another command file returns to its invoking command file, rather than to the MS-Kermit> prompt. There is currently no parameter substitution mechanism for TAKE files. Warnings: - An explicit query mark ("?") in a TAKE file will cause a help message to be displayed and the rest of the line will be read as another com- mand. - Since TAKE file processing discards all characters from a line begin- ning with the first semicolon, it is normally not possible to include semicolons as part of the commands themselves, e.g. get dska:foo.bar;6 To get around this restriction, you may precede such semicolons with a backslash: get dska:foo.bar\;6 The -F Command Syntax: -F filespec The "-f" command is effective only on the DOS command line. It instructs MS-Kermit to use the specified file as its initialization file, rather than MSKERMIT.INI. Unlike other command-line arguments, "-f" does not, of itself, cause MS-Kermit to exit upon completion. Example: C>kermit -f sunday.ini Kermit-MS> The -F command line option allows different MS-Kermit initialization files to coexist. You can create batch commands to invoke Kermit in different ways, for instance MONDAY.BAT might contain "kermit -f monday.ini", TUESDAY.BAT "kermit -f tuesday.ini", etc. The ECHO Command Syntax: ECHO [string] The ECHO command writes the string to the screen, without adding a carriage return or line feed. ECHO may be used to report progress during execution of a TAKE command file, or to issue prompts during the execution of a script. ECHO Part one completed...\13\10 The numbers at the end are "backslash codes" for ASCII control characters, in this case carriage return (\13) and linefeed (\10). Since the ECHO command in- terprets backslash codes, ANSI.SYS and similar console drivers can be programmed through this command by embedding ANSI escape sequences (see section 1.15.3) in the echo string. The COMMENT Command Syntax: COMMENT text The COMMENT command lets you add comments to a TAKE command file. The word COMMENT (or any unique prefix thereof) must appear as the first word on the line. The COMMENT command may also be entered interactively. It has no effect at all. Comments may also be entered in TAKE files, but not on interactive command lines, by using the semicolon (";") character. Unlike the COMMENT com- mand, semicolon comments may appear on the same line as a Kermit command. Ex- ample: COMMENT - MS-Kermit command file to connect port 2 to an IBM mainframe set port 2 set speed 4800 ; Baud rate is 4800 do ibm ; Set parameters for IBM linemode connect ; Be a terminal Question marks should not be included in comments, as they will invoke the help function. The DEFINE Command Syntax: DEFINE macro-name [command [, command [, ...]]] Command macros provide another way of collecting many commands into a single command. The difference between a macro and a TAKE file is that Kermit keeps all its macro definitions in memory, and can execute them as many times as you like, without having to look them up on disk, whereas every time you issue a TAKE command, Kermit has to access a disk. But... you can have as many TAKE command files as you like, and they can be as long as you want, whereas MS-Kermit's memory for storing macro definitions is limited. You can put macro definitions and DO commands for them in TAKE files (or for that matter, you can put TAKE commands in macro definitions). Kermit-MS command macros are constructed with the DEFINE command. Any Kermit-MS commands may be included. Example: define telenet set parity mark, set baud 1200, connect A macro can be undefined by typing an empty DEFINE command for it, like define telenet A macro definition may be no longer than 128 characters. Longer definitions can be accomplished by "chaining." Example: define setup set port 1, set speed 19200, set par even, do setup2 define setup2 set flo no, set handsh xon, set local on, do setup3 define setup3 set timer on, set terminal color 1 31 45, do setup4 define setup4 set warning on, set incomplete keep, connect DO SETUP will invoke all of these commands. The commas above stand for the carriage returns needed by individual commands. Commas must be used to separate commands in macro definitions; carriage returns (\13) cannot be used. When control or other special characters are needed in a macro they may be ex- pressed in backslash number form, \nnn. The SHOW MACROS command displays the value of all currently defined macros, and tells how much space is left for further definitions. The DO Command Syntax: DO macro-name A Kermit-MS command macro is invoked using the DO command. For instance, Kermit-MS comes with a predefined macro to allow convenient setup for IBM mainframe line-mode communications; to invoke it, you would type DO IBM. The IBM macro is defined as "set timer on, set local-echo on, set parity mark, handshake xon, set flow none". You can use the DEFINE command to redefine this macro or remove the definition altogether. There is no automatic way to undo the effect of a macro. If you need to ac- complish this effect, you should define another macro for that purpose. For instance, to undo the effect of "do ibm" so that you could connect to, say, a DEC VAX, you could: def vax set par none,set hand none,set flo x,set tim off,set loc off Then you can "do ibm" whenever you want to use the IBM system, and "do vax" whenever you want to use the VAX. If you wish to view the macro expansion whenever you issue a DO command, you can SET TAKE-ECHO ON. Local File Management Commands These commands are executed on your local PC, and generally invoke DOS ser- vices. This allows you to perform common DOS functions without leaving Kermit. All file specifications may include device and/or directory fields. The local file management commands are: CWD path Changes the current working directory to the given path. All references to local file names without explicit paths will refer to that path. A drive letter may be included to also change disk drives. This command affects Kermit and any inferior programs that you RUN or PUSH to, but your previous disk and directory are restored when you exit from Kermit. DELETE filespec Deletes the specified file or files. As in DOS, the names of the deleted files are not listed, only the message "file(s) deleted" or "file(s) not found", and if you give the command "delete *.*", Kermit-MS will prompt "Are you sure?" since DOS is doing the work. DIRECTORY [filespec] Lists the names, sizes, and creation dates of files that match the given file specification. If no filespec is given, the command is equivalent to DIR *.*. Normal DOS switches are effective. SPACE Performs the MS-DOS CHKDSK function by running the CHKDSK program from the current path. CHKDSK summarizes your disk and memory usage. RUN command Passes the command line to COMMAND.COM for execution. Any legal DOS operation is permitted: running a program (perhaps with command line arguments or i/o redirection), executing a DOS command, or executing a batch file. The COMMAND.COM file should be in the current path. Ker- mit is suspended while the command is executed and automatically resumes afterward. You may even nest RUN KERMIT commands several times if memory is available. The command will be executed directly by COMMAND.COM so follow the rules of DOS. Example: Kermit-MS>run more < kim.txt TYPE filespec Displays the specified local file on the screen. Automatic pause is not available at the end of a page (but see above example for how to accomplish this). On most systems, Ctrl-S can be typed to stop scroll- ing and Ctrl-Q to continue scrolling. 1.6.2. COMMANDS FOR TERMINAL CONNECTION The CONNECT command connects your PC as a terminal to the remote system so that you may conduct a session there, and the HANGUP command may be used to discon- nect your modem (if you have one) from the remote system. There is presently no DIAL command; modems may be dialed "manually" during CONNECT or by using scripts. Scripts are described in detail in subsequent sections. For completeness, the descriptions below contain copious reference to the SET commands, which let you modify all sorts of terminal and communication parameters (the SET commands are described in a later section). MS-Kermit is initially set up with the following parameters, so that you only need to issue SET commands for those that need to be changed: PORT 1 (in most cases, e.g. COM1 on the IBM PC family) TERMINAL VT102(*) emulation (on the IBM PC family and DEC Rainbow) SPEED Whatever the serial card is currently set to. PARITY None FLOW-CONTROL XON/XOFF HANDSHAKE None LOCAL-ECHO Off DISPLAY 7-bit characters INPUT TRANSLATION Off ESCAPE Control-Rightbracket (*) The VT102 terminal is compatible with the VT100, but includes a few ad- ditional functions. The CONNECT Command Syntax: CONNECT -or- C The CONNECT command establishes an interactive terminal connection to the remote system using the currently selected communications port (SET PORT COM1 or COM2) with all settings currently in effect for that port, emulating the currently selected type of terminal. During CONNECT, the characters you type are sent out the communication port, and the characters that arrive at the port are displayed on the screen or in- terpreted by the selected terminal emulator. If you SET LOCAL-ECHO ON, MS-Kermit will also display the characters you type on the screen. Before you issue the CONNECT command, be sure to set the correct communication speed (SET SPEED) and any other necessary communication parameters (e.g. SET PARITY, SET LOCAL-ECHO). If you have SET DEBUG ON, then (on certain systems, particularly the IBM PC), terminal emulation will be disabled and received con- trol characters will be displayed in special notation. By default, 7-bit ASCII characters are displayed on the screen. If you SET DISPLAY 8, then 8-bit characters will be used (useful for "national" character sets). Character translation will be done according to any SET TRANSLATION IN- PUT and SET KEY commands you have issued. In addition, characters that are sent to the screen will also be recorded in a disk file or on a printer if you have issued a LOG SESSION command. To get back to the PC, type the escape character followed by the letter C (for "Close connection"). On most MS-DOS systems the escape character is Ctrl-] (Control-Rightbracket). That means, hold down the Ctrl key, press "]", and then type the letter C. Kermit-MS>connect Connect to remote system. Conduct terminal session here... ^]c Escape back to PC. Kermit-MS> Prompt reappears. This is called "escaping back". You can use the SET ESCAPE command to change the escape character to something besides "^]", or you can assign the escaping- back operation to a single key or key combination with SET KEY (on the IBM PC the default for this is Alt-X). You can include the CONNECT command in a TAKE command file, but not "bare" text to be sent to the remote system during CONNECT (use scripts for that, see Sec- tion 1.7). When a TAKE file includes a CONNECT command, no further commands will be executed from the file until after you escape back. When you CONNECT, the program attempts to raise the DTR and RTS RS-232 signals, and it takes no specific action to lower them unless you explicitly issue the HANGUP command; thus you can EXIT from Kermit-MS and restart it without drop- ping a dialup connection. While CONNECTed, you can communicate directly with an autodialer or "smart modem" to control the communications line, hang it up, and the like, for instance, by typing AT commands to a Hayes-like modem. Kermit-MS>set speed 2400 (See Section 1.6.9) Kermit-MS>connect AT Now you're talking to the modem. OK Your modem responds ATDT8765432 Type the modem's dialing command. RINGING CONNECT 2400 Welcome to ... Now you're talking to the host computer. Please login: MS-Kermit makes no attempt to monitor the modem's Carrier Detect (CD) or Data Set Ready (DSR) signals, and will take no notice if they drop. Thus it is not possible to automatically terminate a session if the connection is broken. However, you may query the status of these modem signals yourself using Kermit's SHOW MODEM command. When using Kermit to connect two PCs "back to back," SET LOCAL-ECHO ON so that when you CONNECT to the other PC to send messages to its operator, you can see what you are typing. Depending on the system, you may have to type a carriage return and a linefeed (Control-J) at the end of each line in order to make the display look right. The HANGUP Command On serial port connections, the HANGUP command attempts to momentarily lower the modem signals DTR and RTS. It may be used to hang up the phone when dialed up through a modem, or to get the attention of port contention units or ter- minal concentrators that operate in this manner. On direct connections, it will probably have no effect. On local area network connections, the network session is fully terminated. TERMINAL EMULATION The IBM PC version of Kermit-MS emulates the DEC VT102 terminal by default, and may also be instructed to emulate the DEC VT52, the Heath/Zenith-19, the Tektronix 4010 graphics terminal, or no terminal at all, selectable with the SET TERMINAL command. Emulation of each of these terminals is nearly complete. VT102 emulation lacks only smooth scroll and 132 column mode (some EGA boards allow it). Double-height, double-width characters are supported, but simulated using ordinary characters. The IBM PC's 40-column (large character) screen mode may be used with Kermit. This can provide improved readability to visually impaired persons. To use 40-column mode, enter the DOS command "MODE 40" (or CO40 or BW40). You can even enter this command from within Kermit ("run mode co40"). You should also inform the host that your terminal width is 40, rather than the normal 80. In 40-column mode, the right half of the mode line (see below) and the pull-down help menu are lost, and the help messages wrap around, but otherwise operation is mostly normal. It's probably best to SET MODE-LINE OFF in 40-column mode. On color monitors, the foreground and background colors may be set using SET TERMINAL COLOR, and inverse/normal video display may also be selected, along with many other terminal parameters. A complete list of the commands, default key configurations, and escape sequences accepted by the IBM PC Kermit terminal emulator is given in section 1.15.1. Non-IBM-compatible PCs have different terminal emulation options. See section 1.9. Escape-Level Commands The escape character, normally Control-], is used to regain the attention of Kermit-MS during CONNECT (you can change the escape character using SET ESCAPE). When you type the escape character, Kermit-MS waits for you to follow it with a single character command. For instance, the single character command "?" produces a list of available single character commands. This command is executed immediately; it may not be edited, and the program does not wait for a carriage return to confirm it. Table 1-2 shows CONNECT escape-level commands available in Kermit-MS. ------------------------------------------------------------------------------- ? Help -- Lists the available single-character commands. 0 (the digit zero) Transmit a NUL (ASCII 0). B Transmit a BREAK signal. L Transmit a Long BREAK signal (on some systems). C Close the connection and return to Kermit-MS prompt level. H Hangup the phone by lowering DTR and CTS momentarily. F File the current screen in the screen dump file. M Toggle the mode line, i.e. turn it off if it is on or vice versa. P Push to DOS; get back to CONNECT by typing EXIT. Q Temporarily quit logging the remote session. R Resume logging the remote session. S Show the status of the connection. ^] (or whatever you have set the escape character to be) Typing the escape character twice sends one copy of it to the connected host. Table 1-2: Kermit Single-Character CONNECT Escape Commands ------------------------------------------------------------------------------- Typing any other character (except the space bar, which is the "null command") after the escape character will cause Kermit-MS to beep, but will do no harm. These actions are also Kermit action verbs and can be assigned to single keys. See SET KEY for details. The Mode Line When you first issue the CONNECT command, a message (on some systems, an in- verse video "mode line") will display the most important facts about the con- nection you've just established, so that you can quickly diagnose any problems. Here's what the IBM PC mode line looks like: Esc-chr:^] help:^]? port:1 speed:9600 parity:odd echo:rem VT102 .... PRN This shows that the escape character is Ctrl-Rightbracket, that you would type Ctrl-rightbracket followed by question mark ("^]?") to get help during CONNECT, that you are connected on port 1 at 9600 baud with odd parity and remote echo, and that a VT102 terminal is being emulated. The four dots represent the VT102s LEDs (they turn into the digits 1,2,3,4 when "lit") and PRN will show up if the printer is activated (e.g. by Ctrl-PrintScreen). The mode line may be turned on and off using SET MODE, or the CONNECT escape character followed by the letter M. Screen Rollback On the IBM PC and some other systems (see Table 1-5), Kermit-MS provides several pages of screen memory which let you recall earlier terminal screens. These may be scrolled up and down using keys as shown in Table 1-6. For in- stance, the IBM PC uses PgUp (previous screen), PgDn (next screen), Ctrl-PgUp and Ctrl-PgDn (one line at a time). Only lines that scroll off the top of the screen are saved. When an application clears the screen, that screen is not saved. These functions and others may be assigned to different keys with the SET KEY command. If you have rolled the screen back and a new character must be displayed, it will normally appear at the current cursor position on the old screen. This is useful when you are trying to copy something from a previous screen. If you wish new characters to appear in their proper place on the "newest" screen, you can SET TERMINAL ROLL ON. Screen Dump The screen dump feature writes the contents of the current screen to a file (KERMIT.SCN unless another file was selected by the SET DUMP command) when the CONNECT escape-level command F is typed. The screen dump file is appended to on each successive screen dump, with each screen separated by a formfeed (Ctrl-L). This feature may be used in conjunction with screen rollback -- a handy way to recapture screenfuls of laboriously typed-in text after a remote host has crashed without saving your work. The corresponding action verb is "dump". Screen dump does not function when in Tektronix graphics mode; instead one of many graphics screen capture programs may be used independently commonly via the DOS Shift PrtSc key combination or by LOGging the incoming byte stream. A screen dump differs from a session log in two ways. First, each desired screen must be manually filed, and second, the screen dump file has been stripped of any escape sequences, whereas the session log records them (see LOG SESSION). Printer Control During terminal emulation, a locally attached printer may be controlled in the normal manner, on most systems. Pushing the "Print Screen" key (shifted on some systems) will cause the current contents of the screen to be printed by DOS; holding down Ctrl while depressing Print Screen will alternately start and stop the spooling of incoming characters to the printer. On the IBM PC, the mode line will show PRN when the printer is activated in this manner. ^P or ^N are sent to the host during terminal emulation and do not toggle printing as they do when you're talking directly to DOS. CTRL-Print-Screen can be simu- lated with the Kermit-MS LOG PRN and CLOSE commands. VT102 (ANSI) style host-controlled transparent printing is also supported on the IBM PC. See sec- tion 1.16.6 for technical information about MS-Kermit's printer control. Graphics MS-Kermit on the IBM PC, compatibles, and several other systems, is capable of emulating a Tektronix 4010 graphics terminal, for use with host-based software that can generate Tektronix control codes. When you enter Tektronix emulation, your cursor will disappear. Don't be alarmed, this is how Tektronix terminals behave. The Tektronix emulator implements a mixture of Tek 4010 and 4014 features to draw characters, lines, and dots in graphics mode. These Tektronix terminals have a graphics display 780 dots high by 1024 dots wide. They use storage tube technology whereby a dot stays illuminated until the full screen is erased. They also lack cursor keys. Kermit's Tek emulator maps the 1024 by 780 dot display to the PC's current screen dimensions, say 640 across by 200 or 350 dots high, and retains limited use of the cursor keys. It automatically senses the active display adapter (EGA, CGA, Hercules, Mono, and AT&T/Olivetti 640x400) and retains screen coloring (EGA) and the current graphics image (EGA and Hercules) if the adapter has sufficient memory. Pure monochrome systems, of course, lack a graphics capability; in this case Kermit approximates the graphic image by writing dots as plus signs. Tektronix graphics mode is entered two different ways, automatically and volun- tarily: 1. Automatically (which you can prevent via the Kermit command DISABLE TEK). While emulating a VT102, VT52, or Heath-19, reception of the byte pair ESCAPE Control-L causes the PC to change to graphics mode, clear the screen, and obey new input as Tektronix commands. A second automatic entry is reception of the escape sequence "ESC [ ? 3 8 h" which does the same as above except the screen is not cleared. Automatic mode is exited by either reception of Control-X or "ESC [ ? 3 8 l" (lower case L), or by toggling the ter- minal type (ALT minus, Kermit verb\KTermtype) to VT102, or something other than TEK. (These "ESC [ ? 3 8 h/l" sequences derive from the DEC VT340 terminal.) 2. Voluntary mode is when terminal type TEK4010 is selected by the Ker- mit command SET TERMINAL TEK4010 or by toggling to it as above. It is exited by SET TERMINAL another-kind or by toggling to another kind. ENABLE or DISABLE TEK and the exit-Tek-mode escape sequences are not applicable to voluntary mode. Here are several common questions about Tek mode, and their answers: 1. "How do I escape from graphics mode back to being a regular terminal?" Within CONNECT mode, you can type the \KTermtype key, which is assigned by default to Alt-Minus. Repeated pressing of this key "toggles" among Kermit's terminal types, VT102, VT52, Heath-19, and Tektronix. You can also escape back to Kermit-MS com- mand level and issue an explicit SET TERMINAL command to change the terminal type. 2. "How can I return to the graphics screen without erasing it?" The graphics screen is preserved if your graphics adapter has sufficient memory (see Table 1-3). In this case, both your text and graphics screens will be preserved when you toggle back and forth between a character terminal (e.g. VT102) and Tektronix. 3. "How do I erase the graphics screen?" You can type the \KReset key, which is normally assigned to Alt-=. The screen also clears if the host sends a Control-L or ESC Control-L. While acting as a Tek terminal Kermit uses the keyboard translation appropriate to the VT102 terminal. However, received escape sequences are interpreted by the Tek emulator and VT102 escape codes are inoperative. The Tek emulator ab- sorbs the ESCAPE and following character and treats any additional unknown items as ordinary text. The emulator can display text characters from a built-in 8-by-8 dot font for characters Space through DELete (no control codes nor special characters). A backspace operation erases the character under the final cursor location (an extension beyond a real Tektronix 4010). Tabs are converted to single spaces. Only the low 7 bits of the character are used. While in Tek mode the emulator behaves as a simple TTY device for ordinary text and as a line or dot drawing Tektronix device for commands listed in Table 1-8. The screen resolution is governed by the kind of active display adapter and monitor in the PC (Table 1-3). Kermit senses this automatically when graphics mode is entered. Graphics are saved on page 1 of screen memory. Coloring is determined by the current terminal status, either the default screen or that overridden by the command SET TERMINAL COLOR. ------------------------------------------------------------------------------- Display Adapter Display Mode Screen Resolution and Coloring EGA w/256KB Hi res color 16 dec 640x350, graphics saved, 16 colors. Med res color 14 640x200, graphics saved, 8 colors. Monochrome 15 640x350, graphics saved, b/w. EGA w/64KB Hi res color 16 640x350, graphics not saved, 4 colors of red, white, blue, black. Med res color 14 640x200, graphics saved, 8 colors. Monochrome 15 640x350, graphics not saved. CGA Color 6 640x200, graphics not saved, b/w. Hercules Monochrome none 720x348, graphics saved if memory. Monochrome Monochrome 7 80 by 25 text, graphics not saved. AT&T/Olivetti any 72 640x400, grahics not saved, b/w. Table 1-3: Adapters Supported by IBM PC MS-Kermit for Tektronix Emulation ------------------------------------------------------------------------------- The technical details of Tektronix emulation are presented in section 1.15.7. 1.6.3. COMMANDS FOR FILE TRANSFER MS-Kermit's SEND, GET, and RECEIVE invoke the Kermit file transfer protocol for error-checked transmission of files between MS-Kermit and another Kermit program on the other end of the connection. There are also commands for "raw" transfer of files (no error checking) with systems that don't have Kermit programs: LOG SESSION (for capturing text files on your PC) and TRANSMIT (for uploading text files to the remote system). During file transfer, MS-Kermit normally displays its progress on the screen as shown in Figure 1-1. The items in the right-hand column are updated more or less at random. In the current version, the percent done is filled in only when sending files, not when receiving. Several other display options are also available; see SET DISPLAY. ------------------------------------------------------------------------------- Kermit-MS: V2.30 8 Jan 88 File name: FOT. KBytes transferred: 7 Percent transferred: 52% Sending: In progress Number of packets: 74 Packet length: 93 Number of retries: 2 Last error: None Last warning: None Figure 1-1: MS-Kermit File Transfer Display Screen ------------------------------------------------------------------------------- Although MS-Kermit makes no distinction between text and binary files, most other Kermit programs do. Therefore, before you attempt to transfer binary files with another type of system (say, a VAX, or an IBM mainframe), be sure to give the appropriate command -- usually something like SET FILE TYPE BINARY -- to the Kermit on the remote end. File transfers involving floppy disks will be slow and noisy. Hard disks are much faster (and quieter), and RAM disks faster still (and totally silent). But if you store files on a RAM disk, be sure to move them to a real disk be- fore turning off your PC. And before attempting to transfer files to the PC, make sure you have enough room on the selected device. Kermit does not provide a way for you to change disks during a file transfer. The SEND Command Syntax: SEND filespec1 [filespec2] The SEND command causes a file or file group to be sent from the local MS-DOS system to the Kermit on the remote system. The remote Kermit may be running in either server or interactive mode; in the latter case, you should already have given it a RECEIVE command and escaped back to your PC. S is a special non-unique abbreviation for SEND. filespec1 may contain the wildcard characters "*" to match zero or more characters within a field, and/or "#" (first position) or "?" (elsewhere) to match any single character. If filespec1 contains wildcard characters then all matching files will be sent, in the same order that MS-DOS would show them in a directory listing. If filespec1 specifies a single file, you may direct Kermit-MS to send that file with a different name, given in filespec2. For in- stance, in the command Kermit-MS>send foo.bar framus.widget filespec2 begins with the first nonblank character after filespec1 and ends with the carriage return; thus it may contain blanks or other unusual charac- ters that may be appropriate on the target machine. The alphabetic case of text in filespec2 is preserved in transmission, so if case matters on the tar- get system, be sure to type filespec2 appropriately. If the SEND command is specified by itself on the command line, then you will be prompted separately for the name of the file to send, and the name to send it under: Kermit-MS>send Local Source File: c:\chris\xcom1.txt Remote Destination File: com1.txt If a file can't be opened for read access, standard MS-DOS recovery procedures will take place. For example: Not ready error reading drive A Abort, Retry, Ignore? Kermit remains active even if you select "Abort" (DOS's word, not ours). Files will be sent with their MS-DOS filename and filetype (for instance FOO.TXT, no device or pathname). Special characters in the file name are not converted. If there is no filetype, then only the name will be sent, without the terminating dot. Each file is sent as is, with no conversions done on the data, except for possibly stopping at a terminating Control-Z character (see the SET EOF command). Once you give Kermit-MS the SEND command, the name of each file will be dis- played on your screen as the transfer begins. Packet, retry, and other counts will be displayed along with informational messages during the transfer, in the style specified by SET DISPLAY. If the file is successfully transferred, you will see "Complete", otherwise there will be an error message. When the specified operation is done, the program will sound a beep. Several single-character commands may be given while a file transfer is in progress: ^X (Control-X) Stop sending the current file and go on to the next one, if any. ^Z Stop sending this file, and don't send any further files. ^C Return to Kermit-MS command level immediately without sending any kind of notification to the remote system. (^Z or even ^E is preferable.) ^E Like ^C, but send an Error packet to the remote Kermit in an attempt to bring it back to server or interactive command level. CR Simulate a timeout: resend the current packet, or NAK the expected one. Control-X, Control-Z, and Control-E send the proper protocol messages to the remote Kermit to bring it gracefully to the desired state. Control-C leaves the remote Kermit in whatever state it happens to be in, possibly retransmit- ting its last packet over and over, up to its retry limit. You should only have to use Control-C in dire emergencies (the remote Kermit is stuck, the remote system crashed, etc), or at those times when you realize that you have given a file transfer command to Kermit-MS without first having told the remote Kermit about it. The RECEIVE Command Syntax: RECEIVE [filespec] The RECEIVE command tells Kermit-MS to receive a file or file group from the other system. The file is stored under the name it was transmitted with, ex- cept that any illegal characters are translated to X's. Kermit-MS passively waits for the file to arrive; this command is not to be used when talking to a Kermit server (use GET for that). You should already have issued a SEND com- mand to the remote Kermit and escaped back to Kermit-MS before issuing the RECEIVE command. R is a special non-unique abbreviation for RECEIVE. If the optional filespec is provided, incoming files will be stored under that name. If the filespec is really just a path then files are stored where the path indicates. If it is an actual filename the first incoming file is renamed and any additional files either overwrite the first (if FILE WARNING is OFF) or are renamed slightly from the filespec (digits are added to the end of the main filename part before the dot and extension) if FILE WARNING is ON (the default). The filespec may include any combination of the following fields: Device designator Store the file on the designated device, in the current directory for that device. If no device designator is given, store it on the current default device. Directory path Store the file in the designated directory. If no path given, store the file in the current directory. File name Store the file under the name given. If no name is given, store it under the name it was sent under, converted, if necessary, to suit DOS conven- tions, and modified, if SET WARNING ON, to avoid overwriting any file of the same name in the same directory. If an incoming file does not arrive in its entirety, Kermit-MS will normally discard it and it will not appear in your directory. You may change this be- havior by using the command SET INCOMPLETE KEEP, which will cause as much of the file as arrived to be saved on the disk. The same single-character commands are available as during SEND: ^X Request that the remote Kermit stop sending the current file, and proceed to the next one immediately. Since this is an optional feature of the Kermit protocol, the remote Kermit might not honor the request. ^Z Request that the remote Kermit terminate the entire transfer; this is also an optional feature that may or may not be supported by the remote Kermit. ^C, ^E, and CR operate in the same way as they do during SEND. In this case, ^E should always do what ^Z is supposed to do. If WARNING is OFF and you type ^X or ^Z to interrupt the transfer, you'll ei- ther get a partial new file, or else both the old and the new file of that name will be lost, depending on SET INCOMPLETE. In any case, when WARNING is off, files with the same name as incoming files will not survive. Caution: If an incoming file's name (the part before the dot) corresponds to an MS-DOS device name, such as NUL, COM1, CON, AUX, or PRN, output will go to that device, rather than to a file with that name. This is a feature of MS-DOS. 1.6.4. Hints for Transferring Large Files During a prolonged file transfer session, things can go wrong that are beyond Kermit's control. The longer the session, the greater the probability it will be fatally interrupted. But you can take a few precautions: - Make sure there is sufficient disk space at the receiving end. If possible, first run a disk utility (such as CHKDSK on MS-DOS systems) to clean out any bad disk blocks. - If you are using a telephone connection, make sure your session won't be interrupted by call waiting, people picking up other extensions, etc. - Don't attempt to transfer a single file of many megabytes over a telephone connection. The longer the call, the greater the chance of disconnection (carrier loss). Although it's a bother, it may save time in the long run to break the file up into smaller pieces, trans- fer the pieces, and then recombine on the other end. - SET INCOMPLETE KEEP on the receiving end, so that if the transfer fails, then the partial file will be retained. Then chop the part that wasn't transferred into a separate file, reconnect, and send it. Then join the pieces together. Consider moving truly massive amounts of data on magnetic media. "Never under- stimate the bandwidth of a station wagon full of magnetic tapes!" 1.6.5. Commands for Raw Uploading and Downloading MS-Kermit can be used to send files to, or capture files from, remote systems that do not have Kermit programs available. No error checking or correction is done, so the results can very likely contain corrupted characters, spurts of noise, gaps, or extraneous system messages or prompts. The command for upload- ing is TRANSMIT, and for downloading LOG SESSION. To minimize loss of data during these operations, be sure to SET the FLOW-CONTROL and HANDSHAKE parameters to match the characteristics of the sys- tem on the other end. The TRANSMIT Command Syntax: TRANSMIT filespec [prompt-character] The TRANSMIT command provides a basic raw upload (export) facility to send straight ASCII text files to the host without packets, error checking, or retransmissions, but using all the currently selected communication parameters for flow control, parity, etc. Information is read from the disk file a line at a time, sent out the serial port, and the command waits for a single charac- ter prompt (normally linefeed) from the host before sending the next file line. A disk file line ends with carriage-return-linefeed (CRLF), but only the car- riage return is sent, just as you only type carriage return at the end of a line, not CR and LF. Most remote systems will echo the CR and then also supply a LF, which indicates that they have processed the line and are ready for another one. Setting the prompt to binary zero, \0, makes the TRANSMIT command proceed without waiting for a prompt. Pressing the local Return key simulates arrival of a prompt character. Typically, before using this command to upload a file, you would start a text editor (preferably a line-oriented, rather than full-screen, editor) on the remote host and put it into text insertion mode. When the file has been com- pletely transmitted, you would manually enter the required sequence for getting the editor out of text insertion mode, and then make any necessary corrections by hand. Here's an example for VAX/VMS: Kermit-MS>set flow xon/xoff Set flow control to match VAX/VMS. Kermit-MS>connect Connect to VAX. $ edt foo.txt Start the EDT editor. *i Put it into "insert" mode. ^]c Escape back to Kermit-MS. Kermit-MS>transmit foo.txt Upload the file a line at a time. ... The lines are displayed on your screen. Kermit-MS>connect When done, connect back to the VAX. ^Z Type Ctrl-Z to exit EDT insert mode. *exit Exit from EDT to save the file. $ If transmission appears to be stuck, you can wake it up by typing a carriage return on the keyboard. You can cancel the TRANSMIT command by typing a Control-C. Control-Z's or other control characters in the file may have ad- verse effects on the host. For this reason, you should use TRANSMIT only for files that contain 7-bit printing ASCII characters, spaces, tabs, carriage returns, linefeeds, and possibly formfeeds. The LOG SESSION Command Syntax: LOG SESSION [filespec] The LOG SESSION command lets you copy the characters that appear on your screen during CONNECT into the specified file on the PC. You can use this command to download files by displaying (usually with a command like TYPE) the file on the remote system while logging is in effect. Example: Kermit-MS>set flow xon/xoff Set flow control to match VAX/VMS. Kermit-MS>connect Connect to the VAX. $ type foo.bar Give this command, but don't type CR yet. ^]c Escape back. Kermit-MS>log sess foo.bar Start logging. Kermit-MS>connect Connect back. Now type the carriage return. This is the file FOO.BAR. The file is displayed on your screen Blah blah ... and captured into PC file FOO.BAR. $ The prompt is captured too. ^]c When done, escape back Kermit-MS>close and close the log file. The PC file FOO.BAR now contains a (possibly mutilated) copy of the remote computer's FOO.BAR file. It probably has the remote system's prompt at the end, which you can edit out. The session log can also be used to record typescripts, editing sessions, Tektronix graphics output, or any other output from, or dialog with, the remote computer. The LOG and CLOSE commands are described further below, in section 1.6.8. 1.6.6. Kermit Server Commands Kermit-MS can act as a Kermit server, and can also interact with other Kermit servers. Normally, the remote Kermit is put into server mode. Then the local Kermit becomes a "client", and may issue repeated commands to the server with- out having to connect and escape back repeatedly. Servers can not only trans- fer files, but can also provide a variety of file management functions. The SERVER command puts MS-Kermit into server mode, and the DISABLE and ENABLE com- mands modify the behavior of the server. Kermit servers respond only to information sent as Kermit protocol packets and not to ordinary CONNECT-mode commands. When MS-Kermit is the client, it uses the SEND command (described above) to send files to a server, the GET command (not RECEIVE) to get files from a server, the REMOTE commands to invoke the file management functions of the server, and the BYE, FINISH, or LOGOUT com- mands to shut down the server. The MS-Kermit server can also be returned to interactive mode by typing Ctrl-C or Ctrl-Break on the PC's console keyboard. The SERVER Command Kermit-MS is capable of acting as a full-fledged Kermit server for users coming in through one of the communication ports or a local area network. To put Kermit-MS into server mode, first issue any desired SET commands to select and configure the desired port, then DISABLE any undesired functions, and then type the SERVER command. Kermit-MS will await all further instructions from the client Kermit on the other end of the connection, which may be hardwired, or connected through a network or autoanswer modem. In the following example, a Kermit server is set up for dialing in: Kermit-MS>set port 1 Kermit-MS>set baud 1200 Kermit-MS>connect ATA OK ^]c Kermit-MS>set timer on Kermit-MS>set warning on Kermit-MS>disable all Kermit-MS>server Before putting Kermit in server mode in this case, it was necessary to connect to the modem (in this example, a Hayes) and put it into autoanswer mode by typing the ATA command. MS-Kermit 2.30 server mode supports the following requests: SEND REMOTE CWD REMOTE SEND GET REMOTE DELETE REMOTE SPACE FINISH REMOTE DIRECTORY REMOTE TYPE BYE REMOTE HELP REMOTE WHO LOGO REMOTE HOST REMOTE CWD can be used to change both directories and devices. The REMOTE SEND command accepts a one line message on the command line which will be displayed on the operator's console. An MS-Kermit Server can DISABLE recognition of selected REMOTE commands to help reduce accidents. CAUTION: The method used for most of the REMOTE commands is to invoke a task with the user's command line, redirect standard output to a tem- porary file, $KERMIT$.TMP, send that file back to the remote end, and then delete the file. Sufficient space must be available to store this file. To service DOS commands or user tasks the boot drive must hold a copy of COMMAND.COM. PATH will not be searched (this can be dis- asterous on a floppy disk based system). FURTHER CAUTION: Any of these DOS tasks or programs may encounter an error, and in that case, DOS will generally put the familiar "Abort, Retry, Ignore?" message on the screen, and will wait for an answer from the keyboard. This will hang the server until a human comes to the keyboard and gives a response. The same thing will happen when any program is invoked that interacts with the real console. For instance, REMOTE SPACE works by running CHKDSK and if CHKDSK finds something wrong with the disk while tallying up the space, it will ask (at the console) if you want to it to be fixed. This, too, will hang the serv- er. MORAL: The MS-DOS Kermit server should probably not be used for REMOTE commands unless someone is around to take care of it when it gets stuck. For local network operation, the SET PORT NET command (with no node name) must be issued before the SERVER command. MS-Kermit then becomes a network-wide server, and other client Kermits can start a network session with it by using the name of the Kermit Server, which is shown on the server's screen when SET PORT NET is given. The Kermit Server accepts connections from other Kermits, but only one at a time. There may be many Kermit Servers active on the network simultaneously because each has a unique node name. Operations are exactly the same as with serial port usage and the session (equivalent to a dialed phone connection) is maintained between the pair until too many timeouts occur, or the client Kermit issues a HANGUP command, exits to DOS, or SETs PORT NET to another node. In the latter cases, the server remains available for use by other client Kermits. If a client Kermit issues the BYE or FINISH command, the network server is shut down (unless it was started with FIN disabled). The DISABLE and ENABLE Commands For security purposes, it may be desirable to leave your PC in Kermit server mode so that it can be dialed in to, but with certain functions unavailable to those who dial in. The DISABLE and ENABLE commands provide this control. The DISABLE and ENABLE commands affect the following functions, with the effect of DISABLEs noted: