MAINKERMIT User's Guide, Chapter 2

previous   next   top   contents   index   framed top   this page unframed


2. MAINKERMIT Commands

Table 2–1 lists the current MAINKERMIT commands. All commands and arguments listed can be abbreviated to the shortest unambiguous substring.

Table 2–1. MAINKERMIT Command List
SERVER Enter server mode.
RECEIVE Receive files.
SEND Send files.
SET Set a set option.
EXIT Exit KERMIT to operating system.
QUIT Exit KERMIT to MAINSAIL.
TAKE Take commands from a command file.
CONNECT Start terminal emulator.
DIAL Edit the dial directory
CALL s Call system s, where s is an entry in the dial directory.
GET Get files from remote server.
FINISH Tell remote server to finish.
TEXT Queue a text file.
DATA Queue a data file.
PTEXT Queue a portable text file.
RTEXT Remotely queue a text file.
RDATA Remotely queue a data file.
RPTEXT Remotely queue a portable text file.
SHOWQUEUE Show current transfer queue
REMOTE Execute a remote server command.
REXECUTE Remotely execute a Kermit command.
HISTORY Show the file transaction history.
TYPE Type a local file on the screen.
DELETE Delete a local file.
RENAME Rename a local file.
COPY Copy one local text file to another.
DIRECTORY Display the local directory specified.
INVOKE Invoke a MAINSAIL module.
? Display a list of commands.

2.1. The SEND Command

Syntax: SEND,
SEND fn,
or SEND fn1 fn2

The SEND command with no file name specified starts transmitting the current transfer queue, as specified by previous TEXT, PTEXT, or DATA commands.

If a file name fn is specified, the named file is transferred under the current default file type.

If both an input file name fn1 and an output file name fn2 are supplied, the file fn1 is transferred under the name fn2.

The corresponding Kermit must be in either server or receive mode.

2.2. The RECEIVE Command

Syntax: RECEIVE

The RECEIVE command accepts file transfers from a single SEND command, then returns to the Kermit command level. If the sending Kermit supports file attributes, the file type is set by the File Attribute packet. If no attribute packet is sent, the file type is set to the default file type.

2.3. The GET Command

Syntax: GET,
GET rfn,
or GET rfn1 fn2

Request the remote Kermit to send the remote file named. If the remote Kermit is MAINKERMIT, the rest of the remote transfer queue is sent as well. If the output file name fn2 is specified, the file is stored under that name. The remote Kermit must be in server mode to use this command.

The syntax of this command is different from that for most Kermits. Usually, if no file name is given, the user is prompted for a remote name, then a local file name. In MAINKERMIT a GET with no file name requests the remote Kermit to send its transfer queue. This queue can be built using the RTEXT, RPTEXT, and RDATA commands (see Section 2.6).

2.4. The TEXT, PTEXT, and DATA Commands

Syntax: TEXT fn
or TEXT fn1 fn2;
PTEXT fn
or PTEXT fn1 fn2;
DATA fn
or DATA fn1 fn2

The TEXT command adds the filename fn to the local transfer queue as a text file. If the output file name fn2 is specified, the file fn1 is transferred under the name fn2.

The PTEXT command works the same as the TEXT command except that it does not filter out nulls or other special characters. Character set and eol translation is still done, however. This command should be used for transferring MAINSAIL intmods.

Similarly, the DATA command add the filename to the transfer queue as a data file. If the remote Kermit does not support File Attribute packets, it stores the files as its own default value. Currently, no warning is issued in such a situation.

2.5. The SERVER Command

Syntax: SERVER

The SERVER command puts Kermit in “server mode”. All commands from that point must be in the form of server packets. Table 2–2 lists the commands to which the server responds.

Table 2–2. Server Commands Supported by MAINKERMIT
Command Server Response
GET Send files
SEND Receive files
FINISH Exit server mode
REMOTE DIRECTORY Send directory listing
REMOTE COPY Copy files
REMOTE TYPE Send file to display
REMOTE RENAME Rename a file
REMOTE DELETE Delete a file
RTEXT Add TEXT file to transfer queue
RPTEXT Add PTEXT file to transfer queue
RDATA Add DATA file to transfer queue
REXECUTE Execute a Kermit command

2.6. The RTEXT, RPTEXT, and RDATA Commands

Syntax: RTEXT rfn
or RTEXT rfn1 fn2;
RPTEXT rfn
or RPTEXT rfn1 fn2;
RDATA rfn
or RDATA rfn1 fn2

The RTEXT command sends a TEXT rfn command to a remote server, which causes the remote filename specified to be added to the remote transfer queue. If the output file name fn2 is specified, the file rfn1 is transferred under the name fn2.

The RPTEXT command acts the same way for a portable text file, and the RDATA command acts the same way for a data file. The remote transfer queue can be retrieved by using the GET command. These commands work only for a MAINKERMIT server.

2.7. SHOWQUEUE

The SHOWQUEUE command shows the current list of files queued for transfer.

2.8. The REMOTE, FINISH, and REXECUTE Commands

MAINKERMIT may request a number of services from a remote server. In addition to the SEND, GET, RTEXT, RPTEXT, and RDATA commands already described, Table 2–3 lists other commands.

Table 2–3. Remote Commands
REMOTE DIRECTORY {dn} Request a remote directory be sent. Use the directory name dn if supplied.
REMOTE COPY rf1 rf2 Copy remote file rf1 to rf2.
REMOTE RENAME rf1 rf2 Rename remote file rf1 to rf2.
REMOTE DELETE rf Delete remote file rf.
REMOTE TYPE rf Send the remote file rf to the screen.
FINISH Cause the remote server to exit server mode.
REXECUTE s Execute the Kermit command s.

A few words about the REXECUTE command: this causes the string s to be sent to the remote Kermit's command exec, exactly as if you had typed it in at the command prompt. This feature is supported by the MAINKERMIT server, but may not be supported by other servers. In general, care should be taken with this command, as it is possible to send commands to the remote server that may confuse it (e.g., if you were to change the line while communication was in progress). On the other hand, it can be useful to alter remote SET options. The RTEXT, RPTEXT, and RDATA commands are implemented through the REXECUTE command.

2.9. Local File Manipulation Commands

MAINKERMIT allows some local file manipulation. These commands are listed in in Table 2–4.

Table 2–4. MAINKERMIT Local File Commands
DIRECTORY {dn} Request a directory be sent. Use the directory name dn, if supplied.
COPY f1 f2 Copy file f1 to f2.
RENAME f1 f2 Rename file f1 to f2.
DELETE f Delete file f.
TYPE f Send the file rf to the screen.

2.10. The SET Command

Syntax: SET option {value}

MAINKERMIT has a number of variables and options. The SET command allows the user to tailor these for a specific need. Table 2–5 lists the set options available. These options are described in detail below.

Table 2–5. MAINKERMIT SET Options
LINE Communication device name.
FILETYPE Default file type (text, portable text, or data).
TARGET Target operating system for data files.
BAUD Baud rate of communication device.
DEBUG Toggle the debug switch.
PROMPT Change the Kermit prompt.
BLOCKCHECK [1|2|3] Block checksum type.
RETRIES n Number of retries for bad packet before timing out.
ERRORLOG fileName Error log name.
HALFDUPLEX Turn on local echo.
FULLDUPLEX Turn off local echo.
TRANSLATION ebcdicCharCode asciiCharCode Override default EBCDIC-ASCII conversion.
PARITY Tell MAINKERMIT that local machine is using parity.
NOPARITY Tell MAINKERMIT that local machine is not using parity.
ESCAPE newEscapeCharacter Escape character.

2.10.1. SET LINE deviceName

SET LINE sets the communication device. The device name is the operating-system-specific name for the line you plan to use, e.g., /dev/ttyb or _TXA5:. When the SET LINE command is given, Kermit is put in “local mode”. By default, Kermit is in “remote mode”. After a SET LINE command, it is possible that a SET BAUD command may need to be issued. Note that the SET LINE command is operating-system-dependent, and may not be implemented on all systems.

2.10.2. SET BAUD [300|1200|2400|4800|9600]

Set the baud rate of the line specified in the SET LINE command to the baud rate selected. The command is supported only if the host operating system allows the baud to be set. A SET LINE command must be issued before this command.

2.10.3. SET FILETYPE [TEXT|PTEXT|DATA]

Set the default file type to TEXT, PTEXT, or DATA, as specified. File Attribute packets override this setting, but this is the file type used in the absence of such a packet. By default, the file type is TEXT.

2.10.4. SET TARGET osName

This sets the target used in a data transfer to the operating system name specified. osName is one of the XIDAK operating system name abbreviations shown in Table B–2 of the MAINSAIL Language Manual. Normally, this command can be dispensed with, as most machines support 8-bit bytes.

2.10.5. SET PROMPT s

Set the Kermit command prompt to the specified string s. This can be useful if you are using MAINKERMIT on two different system.

2.10.6. SET DEBUG

Toggle the debug switch. With debug on, packets are dumped to the screen as they are received and sent. This may be useful in tracking down a failing connection.

2.10.7. SET BLOCKCHECK [1|2|3]

This has the standard Kermit meaning of setting the block checksum. 1 is a six-bit arithmetic checksum, 2 is a 12-bit arithmetic checksum, and 3 is a 16-bit CRC.

2.10.8. SET RETRIES n

This variable is the number retries that will be attempted for a bad packet before a transfer times out.

2.10.9. SET ERRORLOG fileName

Save error messages in the specified file.

2.10.10. SET HALFDUPLEX

Set Kermit to echo locally (used when talking to half-duplex system).

2.10.11. SET FULLDUPLEX

Set Kermit not to echo locally (i.e., echo is remote). Used with full-duplex systems.

2.10.12. SET TRANSLATION ebcdicCharCode asciiCharCode

Override the default EBCDIC-ASCII conversion for a particular character code. Codes are entered in decimal.

2.10.13. SET PARITY

Indicate that local machine is using parity.

2.10.14. SET NOPARITY

Indicate that local machine is not using parity.

2.10.15. SET ESCAPE newEscapeCharacter

Set the Kermit escape character (the character used to escape from the terminal emulator). The character is typed as CTRL-characterEntered. For example, the default escape character (CTRL-\) would be entered as SET ESCAPE \.

2.11. The TAKE Command

Syntax: TAKE fn

The TAKE command instructs MAINKERMIT to execute commands from the filename fn. This file may also contain TAKE commands. The commands executed are echoed. Command files are especially useful in building transfer queues.

An implicit TAKE is done on the file kermit.ini when MAINKERMIT is first invoked.

2.12. The CONNECT Command

The CONNECT command causes the terminal to go into a terminal emulator, talking to the line specified by the SET LINE command. All characters typed are passed through the line, and all characters received are displayed. This is an operating-system-specific command, as some operating systems cannot support this function. The quality of the terminal emulator may vary from system to system as well, depending on the exact nature of the primitives provided. Commands to the local Kermit are prefixed with CTRL-\ and a single character. Table 2–6 lists the control codes.

Table 2–6. MAINKERMIT Emulator Commands
c Close the connection, return to the local Kermit
b Send a BREAK (not supported on all systems)
0 Send a NULL
CTRL-\ Send a Control-backslash
? List the control codes accepted

2.13. The DIAL and CALL s Commands

The “dial directory” is a list of host systems and their characteristics. It is maintained in the file kdiald.ini in the user's home directory. It should be edited only by using the MAINKERMIT DIAL command.

The DIAL command enters “dial mode”, which provides the following commands:

INSERT Insert new record
DELETE n Delete record numbered n
EDIT n Edit record number n
CALL s Call system named s
SAVE Save changes
QUIT Return to Kermit prompt (exit dial mode)
EXIT Return to Kermit prompt (exit dial mode)

Upon entry to dial mode, the current dial directory is displayed. Each entry contains a record number, a system name (which may be used as an argument to the CALL command, either in dial mode or at MAINKERMIT's top level), a baud rate to use when calling, a phone number to dial to reach the system, a modem prefix transmitted before the phone number, a modem suffix transmitted after the phone number, and the name of an optional take file (a file of MAINKERMIT commands) that is executed before dialing. The dial mode INSERT and EDIT commands prompt for the values of each of these parameters.

2.14. The HISTORY Command

Syntax: HISTORY

The HISTORY command lists all files transferred since MAINKERMIT was started. The command prints whether the file was sent or received, if it was text, portable text, or data, what the name was, what time it was started and what time it was completed. If the transfer was aborted for any reason, that fact is also noted.


previous   next   top   contents   index   framed top   this page unframed

MAINKERMIT User's Guide, Chapter 2