home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv201txt.zip / ckcbwr.txt < prev    next >
Text File  |  2002-02-13  |  69KB  |  1,367 lines

  1.  
  2.                       C-Kermit 8.0 General Hints and Tips
  3.                                        
  4.      Frank da Cruz
  5.      [1]The Kermit Project, [2]Columbia University
  6.      
  7.    As of: C-Kermit 8.0.201, 8 Feb 2002
  8.    This page last updated: Mon Feb 11 17:49:47 2002 (New York USA Time)
  9.    
  10.      IF YOU ARE READING A PLAIN-TEXT version of this document, note that
  11.      this file is a plain-text dump of a Web page. You can visit the
  12.      original (and possibly more up-to-date) Web page here:
  13.      
  14.   [3]http://www.columbia.edu/kermit/ckcbwr.html
  15.  
  16.    This document contains platform-independent C-Kermit hints and tips.
  17.    Also see the platform-specific C-Kermit hints and tips document for
  18.    your platform, for example:
  19.    
  20.   [4]http://www.columbia.edu/kermit/ckubwr.html
  21.  
  22.    for Unix. This document also applies to [5]Kermit 95 for Windows,
  23.    which is based on C-Kermit.
  24.    
  25.    [ [6]C-Kermit ] [ [7]C-Kermit 8.0 Beta Test ] [ [8]TUTORIAL ]
  26.     ________________________________________________________________________
  27.   
  28.   CONTENTS
  29.   
  30.    1. [9]INCOMPATIBLE CHANGES
  31.    2. [10]THE C-KERMIT COMMAND PARSER
  32.    3. [11]MULTIPLE SESSIONS
  33.    4. [12]NETWORK CONNECTIONS
  34.    5. [13]MODEMS AND DIALING
  35.    6. [14]DIALING HINTS AND TIPS
  36.    7. [15]TERMINAL SERVERS
  37.    8. [16]TERMINAL EMULATION
  38.    9. [17]KEY MAPPING
  39.   10. [18]FILE TRANSFER
  40.   11. [19]SCRIPT PROGRAMMING
  41.     ________________________________________________________________________
  42.   
  43.   1. INCOMPATIBLE CHANGES
  44.   
  45.    [ [20]Top ] [ [21]Contents ] [ [22]Next ]
  46.    
  47.    These are not necessarily exhaustive lists.
  48.    
  49.   1.1. C-Kermit 6.0
  50.   
  51.    C-Kermit 6.0 was released 6 September 1996 and is completely
  52.    documented in [23]Using C-Kermit, 2nd Edition. The following
  53.    incompatible changes were made in C-Kermit 6.0:
  54.    
  55.      * Unless you tell C-Kermit otherwise, if a serial or network
  56.        connection seems to be open, and you attempt to EXIT or to open a
  57.        new connection, C-Kermit warns you that an active connection
  58.        appears to be open and asks you if you really want to close it. If
  59.        you do not want these warnings, add SET EXIT WARNING OFF to your
  60.        customization file.
  61.      * The default for SET { SEND, RECEIVE } PATHNAMES was changed from
  62.        ON to OFF, to prevent unexpected creation of directories and
  63.        depositing of incoming files in places you might not know to look.
  64.      * The default for SET FILE INCOMPLETE was changed from DISCARD to
  65.        KEEP to allow for file transfer recovery.
  66.      * The default file-transfer block-check is now 3, rather than 1. If
  67.        the other Kermit does not support this, the two will drop back to
  68.        type 1 automatically unless the other Kermit fails to follow the
  69.        protocol specification.
  70.      * The default flow-control is now "auto" ("do the right thing for
  71.        each type of connection"), not Xon/Xoff.
  72.      * Backslash (\) is no longer a command continuation character. Only
  73.        - (hyphen, dash) may be used for this in C-Kermit 6.0 and later.
  74.      * Negative INPUT timeout now results in infinite wait, rather than 1
  75.        second.
  76.        
  77.   1.2. C-Kermit 7.0
  78.   
  79.    C-Kermit 7.0 was released 1 January 2000. Its new features are
  80.    documented in the C-Kermit 7.0 Supplement,
  81.    [24]http://www.columbia.edu/kermit/ckermit2.html. The following
  82.    incompatible changes were made in C-Kermit 7.0:
  83.      * The "multiline GET" command is gone. Now use either of the
  84.        following forms instead:
  85.  
  86.   get remote-name local-name
  87.   get /as-name:local-name remote-name
  88.        If either name contains spaces, enclose it in braces (or, in
  89.        C-Kermit 8.0, doublequotes).
  90.      * To send multiple file specifications to a server in a GET command,
  91.        you must now use MGET rather than GET:
  92.  
  93.   mget file1 file2 file3 ...
  94.      * C-Kermit 7.0 uses FAST Kermit protocol settings by default. This
  95.        includes "unprefixing" of certain control characters. Because of
  96.        this, file transfers that worked with previous releases might not
  97.        work in the new release (but it is more likely that they will
  98.        work, and much faster). If a transfer fails, you'll get a
  99.        context-sensitive hint suggesting possible causes and cures.
  100.        Usually SET PREFIXING ALL does the trick.
  101.      * C-Kermit 7.0 transfers files in BINARY mode by default. To restore
  102.        the previous behavior, put SET FILE TYPE TEXT in your C-Kermit
  103.        initialization file.
  104.      * No matter whether FILE TYPE is BINARY or TEXT by default, C-Kermit
  105.        7.0 now switches between text and binary mode automatically on a
  106.        per-file basis according to various criteria, including (a) which
  107.        kind of platform is on the other end of the connection (if known),
  108.        (b) the version of Kermit on the other end, and (c) the file's
  109.        name. To disable this automatic switching and restore the earlier
  110.        behavior, put SET TRANSFER MODE MANUAL in your C-Kermit
  111.        initialization file. To disable automatic switching for a
  112.        particular transfer, include a /TEXT or /BINARY switch with your
  113.        SEND or GET command.
  114.      * The RESEND and REGET commands automatically switch to binary mode;
  115.        previously if RESEND or REGET were attempted when FILE TYPE was
  116.        TEXT, these commands would fail immediately, with a message
  117.        telling you they work only when the FILE TYPE is BINARY. Now they
  118.        simply do this for you.
  119.      * SET PREFIXING CAUTIOUS and MINIMAL now both prefix linefeed (10
  120.        and 138) in case rlogin, ssh, or cu are "in the middle", since
  121.        otherwise <LF>~ might appear in Kermit packets, and this would
  122.        cause rlogin, ssh, or cu to disconnect, suspend,escape back, or
  123.        otherwise wreck the file transfer. Xon and Xoff are now always
  124.        prefixed too, even when Xon/Xoff flow control is not in effect,
  125.        since unprefixing them has proven dangerous on TCP/IP connections.
  126.      * In UNIX, VMS, Windows, and OS/2, the DIRECTORY command is built
  127.        into C-Kermit itself rather than implemented by running an
  128.        external command or program. The built-in command might not behave
  129.        the way the platform-specific external one did, but many options
  130.        are available for customization. Of course the underlying
  131.        platform-specific command can still be accessed with "!", "@", or
  132.        "RUN" wherever the installation does not forbid. In UNIX, the "ls"
  133.        command can be accessed directly as "ls" in C-Kermit.
  134.      * SEND ? prints a list of switches rather than a list of filenames.
  135.        If you want to see a list of filenames, use a (system-dependent)
  136.        construction such as SEND ./? (for UNIX, Windows, or OS/2), SEND
  137.        []? (VMS), etc.
  138.      * In UNIX, OS-9, and Kermit 95, the wildcard characters in previous
  139.        versions were * and ?. In C-Kermit 7.0 they are *, ?, [, ], {, and
  140.        }, with dash used inside []'s to denote ranges and comma used
  141.        inside {} to separate list elements. If you need to include any of
  142.        these characters literally in a filename, precede each one with
  143.        backslash (\).
  144.      * SET QUIET { ON, OFF } is now on the command stack, just like SET
  145.        INPUT CASE, SET COUNT, SET MACRO ERROR, etc, as described on p.458
  146.        of [25]Using C-Kermit, 2nd Edition. This allows any macro or
  147.        command file to SET QUIET ON or OFF without worrying about saving
  148.        and restoring the global QUIET value. For example, this lets you
  149.        write a script that tries SET LINE on lots of devices until it
  150.        finds one free without spewing out loads of error messages, and
  151.        also without disturbing the global QUIET setting, whatever it was.
  152.      * Because of the new "." operator (which introduces assignments),
  153.        macros whose names begin with "." can not be invoked "by name".
  154.        However, they still can be invoked with DO.
  155.      * The syntax of the EVALUATE command has changed. To restore the
  156.        previous syntax, use SET EVALUATE OLD.
  157.      * The \v(directory) variable now includes the trailing directory
  158.        separator; in previous releases it did not. This is to allow
  159.        constructions such as:
  160.  
  161.   cd \v(dir)data.tmp
  162.        to work across platforms that might have different directory
  163.        notation, such as UNIX, Windows, and VMS.
  164.      * Prior to C-Kermit 7.0, the FLOW-CONTROL setting was global and
  165.        sticky. In C-Kermit 7.0, there is an array of default flow-control
  166.        values for each kind of connection, that are applied automatically
  167.        at SET LINE/PORT/HOST time. Thus a SET FLOW command given before
  168.        SET LINE/PORT/HOST is likely to be undone. Therefore SET FLOW can
  169.        be guaranteed to have the desired effect only if given after the
  170.        SET LINE/PORT/HOST command.
  171.      * Character-set translation works differently in the TRANSMIT
  172.        command when (a) the file character-set is not the same as the
  173.        local end of the terminal character-set, or (b) when the terminal
  174.        character-set is TRANSPARENT.
  175.        
  176.   1.3. C-Kermit 8.0
  177.   
  178.    The following incompatible changes were made in C-Kermit 8.0:
  179.      * C-Kermit now accepts doublequotes in most contexts where you
  180.        previously had to use braces to group multiple words into a single
  181.        field, or to force inclusion of leading or trailing blanks. This
  182.        might cause problems in context where you wanted the doublequote
  183.        characters to be taken literally.
  184.      * Using the SET HOST command to make HTTP connections is no longer
  185.        supported. Instead, use the new HTTP OPEN command.
  186.     ________________________________________________________________________
  187.   
  188.   2. THE C-KERMIT COMMAND PARSER
  189.   
  190.    [ [26]Top ] [ [27]Contents ] [ [28]Next ] [ [29]Previous ]
  191.    
  192.    Various command-related limits are shown in the following table, in
  193.    which the sample values are for a "large memory model" build of
  194.    C-Kermit, typical for modern platforms (Linux, Solaris, AIX, VMS,
  195.    etc). You can see the values for your version of Kermit by giving the
  196.    SHOW FEATURES command. The maximum length for a Kermit command (CMDBL)
  197.    also determines the maximum length for a macro definition, since
  198.    DEFINE is itself a command. The maximum length for a variable name is
  199.    between 256 and 4096 characters, depending on the platform; for array
  200.    declarations and references, that includes the subscript.
  201.        ______________________________________________________________
  202.      
  203.      Item Symbol Sample
  204.      Value Definition
  205.      Number of characters in a command CMDBL 32763 ckucmd.h
  206.      Number of chars in a field of a command    ATMBL 10238 ckucmd.h
  207.      Nesting level for command files MAXTAKE 54   ckuusr.h
  208.      Nesting level for macros MACLEVEL 128 ckuusr.h
  209.      Nesting level for FOR / WHILE loops FORDEPTH 32 ckuusr.h
  210.      Number of macros MAC_MAX 16384 ckuusr.h
  211.      Size of INPUT buffer INPBUFSIZ 4096 ckuusr.h
  212.      Maximum files to match a wildcard MAXWLD    102400 ckcdeb.h
  213.      Filespecs in MSEND command MSENDMAX 1024 ckuusr.h
  214.      Length for GOTO target label LBLSIZ 50 ckuusr.h
  215.      \fexecute() recursion depth limit CMDDEP 64 ckucmd.h
  216.        ______________________________________________________________
  217.      
  218.    If you need to define a macro that is longer than CMDBL, you can break
  219.    the macro up into sub-macros or rewrite the macro as a command file.
  220.    In a pinch you can also redefine CMDBL and recompile C-Kermit. All of
  221.    these numbers represent tradeoffs: the bigger the number, the more
  222.    "powerful" Kermit in the corresponding area, but also the bigger the
  223.    program image and possibly disk footprint, and the longer it takes to
  224.    load and initialize.
  225.    
  226.    In the interactive command parser:
  227.    
  228.      * EMACS- or VI-style command line editing is not supported.
  229.      * Editing keys are hardwired (Ctrl-U, Ctrl-W, etc).
  230.        
  231.    If you interrupt C-Kermit before it has issued its first prompt, it
  232.    will exit. This means that you cannot interrupt execution of the
  233.    initialization file, or of an "application file" (file whose name is
  234.    given as the first command-line argument), or of an alternative
  235.    initialization file ("-y filename"), and get to the prompt. There is,
  236.    however, one exception to this rule: you *can* interrupt commands --
  237.    including TAKE commands -- given in the '-C "command list"'
  238.    command-line argument and -- if there were no action commands among
  239.    the command-line arguments -- you will be returned to the C-Kermit
  240.    prompt. So, for example, if you want to start C-Kermit in such a way
  241.    that it executes a command file before issuing its first prompt, and
  242.    you also want to be able to interrupt the command file and get to the
  243.    prompt, include a TAKE command for the desired command in the -C
  244.    argument, for example:
  245.    
  246.   kermit -C "take dial.scr"
  247.  
  248.    At the command prompt, if you use the backslash (\) prefix to enter a
  249.    control character, space, or question mark into a command literally,
  250.    the backslash disappears and is replaced by the quoted character. If
  251.    it was a control character, it is shown as a circumflex (^). This
  252.    allows editing (backspace, delete, Ctrl-W) to work correctly even for
  253.    control characters.
  254.    
  255.    Priot to C-Kermit 8.0, the only way to include a comma literally in a
  256.    macro definition -- as opposed to having it separate commands within
  257.    the definition -- is to enter its ASCII value (44) in backslash
  258.    notation, e.g.:
  259.    
  260.   DEFINE ROWS RUN MODE CO80\{44}\%1
  261.  
  262.    In C-Kermit 8.0 you can use constructions like this:
  263.    
  264.   DEFINE ROWS RUN MODE "CO80,\%1"
  265.  
  266.    If you quote special characters in a filename (e.g. in the SEND
  267.    command), filename completion may seem to work incorrectly. For
  268.    example, if you have a file whose name is a*b (the name really
  269.    contains an asterisk), and you type "send a\\*<ESC>", the "b" does not
  270.    appear, nor will Ctrl-R redisplay the completed name correctly. But
  271.    internally the file name is recognized anyway.
  272.    
  273.    Question-mark help does not work during execution of an ASKQ command.
  274.    The question marks are simply accepted as text.
  275.    
  276.    In OUTPUT commands only, \B sends a BREAK signal, \L sends a Long
  277.    BREAK signal, and \N sends a NUL (ASCII 0). BREAK and Long BREAK are
  278.    special signals, not characters, and NUL is a character that normally
  279.    cannot be included in a C string, since it is the C string terminator.
  280.    If you really want to output a backslash followed by a B, an L, or an
  281.    N (as is needed to configure certain modems, etc), double the
  282.    backslash, e.g. "output \\B". In C-Kermit 7.0 or later, you can disarm
  283.    and re-arm the special OUTPUT-command escapes (\B, \L, and \N) with
  284.    SET OUTPUT SPECIAL-ESCAPES { OFF, ON }.
  285.    
  286.    When using the command-line processor ("kermit -l /dev/tty00 -b
  287.    19200", etc), note that in some cases the order of the command-line
  288.    options makes a difference, contrary to the expectation that order of
  289.    command-line options should not matter. For example, the -b option
  290.    must be given after the -l option if it is to affect the device
  291.    specified in the -l option.
  292.     ________________________________________________________________________
  293.   
  294.   3. MULTIPLE SESSIONS
  295.   
  296.    [ [30]Top ] [ [31]Contents ] [ [32]Next ] [ [33]Previous ]
  297.    
  298.    C-Kermit 7.0 and earlier do not support multiple sessions. When you
  299.    SET LINE (or SET PORT, same thing) to a new device, or SET HOST to a
  300.    new host, the previous SET LINE device or network host connection is
  301.    closed, resulting in hangup of the modem or termination of the network
  302.    connection. In windowing environments like HP-VUE, NeXTSTEP, Windows,
  303.    OS/2, etc, you can run separate copies of Kermit in different windows
  304.    to achieve multiple sessions.
  305.    
  306.    To achieve multiple sessions through a single serial port (e.g. when
  307.    dialing up), you can install SLIP or PPP on your computer and then use
  308.    C-Kermit's TCP/IP support over the SLIP or PPP connection, assuming
  309.    you also have TCP/IP networking installed on your computer.
  310.    
  311.    C-Kermit 8.0 has the same restriction on SET LINE and SET HOST
  312.    sessions: only one regular session (dialout, Telnet, etc) can be open
  313.    at a time. However, version 8.0 adds two new kinds of sessions: FTP
  314.    and HTTP; one or both of these can be open at the same as a regular
  315.    session.
  316.     ________________________________________________________________________
  317.   
  318.   4. NETWORK CONNECTIONS
  319.   
  320.    [ [34]Top ] [ [35]Contents ] [ [36]Next ] [ [37]Previous ]
  321.    
  322.    The most frequently asked question in many newsgroups is "Why does it
  323.    take such a long time to make a Telnet connection to (or from) my
  324.    (e.g.) Linux PC?" (this applies to C-Kermit or to regular Telnet):
  325.    
  326.     1. Most Telnet servers perform reverse DNS lookups on the client (for
  327.        security and/or logging reasons). If the Telnet client's host
  328.        cannot be found by the server's local DNS server, the DNS request
  329.        goes out to the Internet at large, and this can take quite some
  330.        time. The solution to this problem is to make sure that both
  331.        client and host are registered in DNS.
  332.     2. C-Kermit itself performs reverse DNS lookups unless you tell it
  333.        not to. This is to allow C-Kermit to let you know which host it is
  334.        actually connected to in case you have made a connection to a
  335.        "host pool" (multihomed host). You can disable C-Kermit's reverse
  336.        DNS lookup with SET TCP REVERSE-DNS-LOOKUP OFF.
  337.     3. C-Kermit 7.0 and later strictly enforce Telnet protocol rules. One
  338.        such rule is that certain negotiations must be responded to. If
  339.        C-Kermit sends a such a negotiation and the host does not respond,
  340.        C-Kermit waits a long time for the reply (in case the network is
  341.        congested or the host is slow), but eventually will time out. To
  342.        eliminate the waits (and therefore risk possible protocol
  343.        mismatches -- or worse -- between Telnet client and server), tell
  344.        C-Kermit to SET TELNET WAIT OFF (or include the /NOWAIT switch
  345.        with the TELNET command).
  346.        
  347.    In multiuser operating systems such as UNIX and VMS, TCP/IP Rlogin
  348.    connections are available only to privileged users, since "login" is a
  349.    privileged socket. Assuming you are allowed to use it in the first
  350.    place, it is likely to behave differently depending on what type of
  351.    host you are rlogging in to, due to technical reasons having to do
  352.    with conflicting interpretations of RFC793 (Out-Of-Band Data) and
  353.    Rlogin (RFC1122)... "Specifically, the TCP urgent pointer in BSD
  354.    points to the byte after the urgent data byte, and an RFC-compliant
  355.    TCP urgent pointer points to the urgent data byte. As a result, if an
  356.    application sends urgent data from a BSD-compatible implementation to
  357.    an [38]RFC-1122 compatible implementation then the receiver will read
  358.    the wrong urgent data byte (it will read the byte located after the
  359.    correct byte in the data stream as the urgent data byte)." Rlogin
  360.    requires the use of OOB data while Telnet does not. Therefore, it is
  361.    possible for Telnet to work between all systems while BSD and System V
  362.    TCP/IP implementations are almost always a bad mix.
  363.    
  364.    On a TCP/IP TELNET connection, you should normally have PARITY set to
  365.    NONE and (except in VMS C-Kermit) FLOW-CONTROL also set to NONE. If
  366.    file transfer does not work with these settings (for example, because
  367.    the remote TELNET server only gives a 7-bit data path), use SET PARITY
  368.    SPACE. Do not use SET PARITY MARK, EVEN, or ODD on a TELNET connection
  369.    -- it interferes with TELNET protocol.
  370.    
  371.    If echoing does not work right after connecting to a network host or
  372.    after dialing through a TCP/IP modem server, it probably means that
  373.    the TELNET server on the far end of the connection is executing the
  374.    TELNET protocol incorrectly. After initially connecting and
  375.    discovering incorrect echoing (characters are echoed twice, or not at
  376.    all), escape back, give the appropriate SET DUPLEX command (FULL or
  377.    HALF), and then CONNECT again. For a consistently misbehaving
  378.    connection, you can automate this process in a macro or TAKE file.
  379.    
  380.    TELNET sessions are treated just like serial communications sessions
  381.    as far as "terminal bytesize" and "command bytesize" are concerned. If
  382.    you need to view and/or enter 8-bit characters during a TELNET
  383.    session, you must tell C-Kermit to SET TERMINAL BYTESIZE 8, SET
  384.    COMMAND BYTESIZE 8, and SET PARITY NONE.
  385.    
  386.    If you SET TELNET DEBUG ON prior to making a connection, protocol
  387.    negotiations will be displayed on your screen. You can also capture
  388.    them in the debug log (along with everything else) and then extract
  389.    them easily, since all Telnet negotiations lines begin with
  390.    (uppercase) "TELNET".
  391.     ________________________________________________________________________
  392.   
  393.   5. MODEMS AND DIALING
  394.   
  395.    [ [39]Top ] [ [40]Contents ] [ [41]Next ] [ [42]Previous ]
  396.    
  397.    External modems are recommended because:
  398.    
  399.      * They don't need any special drivers.
  400.      * They are less likely to interfere with normal operation of your
  401.        computer.
  402.      * You can use the lights and speaker to troubleshoot dialing.
  403.      * You can share them among all types of computers.
  404.      * You can easily turn them off and on when power-cycling seems
  405.        warranted.
  406.      * They are more likely to have manuals.
  407.        
  408.    Modems can be used by C-Kermit only when they are visible as or
  409.    through a regular serial port device. Certain modems can not be used
  410.    in this normal way on many kinds of computers: Winmodems, RPI modems,
  411.    Controllerless modems, the IBM Mwave, etc; all of these require
  412.    special drivers that perform some, most, or all of the modem's
  413.    functions in software. Such drivers are generally NOT available in
  414.    UNIX or other non-Windows (or non-OS/2, in the case of the Mwave)
  415.    platforms.
  416.    
  417.    In order to dial a modem, C-Kermit must know its repertoire of
  418.    commands and responses. Each modem make and model is likely to have a
  419.    different repertoire. Since Kermit has no way of knowhing which kind
  420.    of modem will be dialed, normally you have to tell it with a SET MODEM
  421.    TYPE command, e.g.:
  422.    
  423.   set modem type usrobotics
  424.   set line /dev/cua0
  425.   set speed 57600
  426.   dial 7654321
  427.  
  428.    In the early days, there was a wide variety of modems and command
  429.    languages. Nowadays, almost every modem uses the Hayes AT command set
  430.    (but with some differences in the details) and its startup
  431.    configuration includes error correction, data compression, and
  432.    hardware (RTS/CTS) flow control. As long as C-Kermit is capable of
  433.    hardware flow control (as it is on many, but not all, the platforms
  434.    where it runs, since some operating systems don't support it), the
  435.    modem can be dailed immediately, without lengthy configuration
  436.    dialogs, and in fact this is what SET MODEM TYPE GENERIC-HIGH-SPEED
  437.    does. In C-Kermit 8.0, GENERIC-HIGH-SPEED has become the default modem
  438.    type, so now it is usually possible to SET LINE, SET SPEED, and DIAL
  439.    without having to identify your modem. If this doesn't work, of
  440.    course, then you might have to fall back to the tradiational method:
  441.    Give a SET MODEM TYPE for a specific modem first, then SET LINE, SET
  442.    SPEED, and DIAL.
  443.    
  444.    An important change in C-Kermit 6.0 is that when you give a SET MODEM
  445.    TYPE command to tell Kermit what kind of modem you have, Kermit also
  446.    sets a number of other modem-related parameters automatically from its
  447.    internal modem database. Thus, the order in which you give
  448.    modem-related commands is significant, whereas in prior releases they
  449.    could be given in any order.
  450.    
  451.    In particular, MODEM SPEED-MATCHING is set according to whether the
  452.    modem is known to be capable of speed buffering. SET MODEM TYPE
  453.    HAYES-2400 automatically turns SPEED-MATCHING ON, because when the
  454.    Hayes 2400 reports a particular speed in its CONNECT message, that
  455.    means its interface speed has changed to that speed, and C-Kermit's
  456.    must change accordingly if it is to continue communicating. This might
  457.    cause some confusion if you use "set modem type hayes" for dialing a
  458.    more advanced type of modem.
  459.    
  460.    The new default for flow control is "auto", meaning "do the right
  461.    thing for each type of connection". So (for example) if your version
  462.    of C-Kermit supports SET FLOW RTS/CTS and your modem also supports
  463.    RTS/CTS, then Kermit automatically sets its flow control to RTS/CTS
  464.    and set modem's flow control to RTS/CTS too before attempting to use
  465.    the modem.
  466.    
  467.    For these reasons, don't assume that "set modem type hayes" should be
  468.    used for all modems that uses the Hayes AT command set. "set modem
  469.    type hayes" really does mean Hayes 1200 or 2400, which in turn means
  470.    no hardware flow control, and no speed buffering. This choice will
  471.    rarely work with a modern high-speed modem.
  472.     ________________________________________________________________________
  473.   
  474.   6. DIALING HINTS AND TIPS
  475.   
  476.    [ [43]Top ] [ [44]Contents ] [ [45]Next ] [ [46]Previous ]
  477.    
  478.    If you have a high-speed, error-correcting, data-compressing,
  479.    speed-buffering modem, you should fix the modem's interface speed as
  480.    high as possible, preferably (at least) four times higher than its
  481.    maximum connection (modulation) speed to allow compression to work at
  482.    full advantage. In this type of setup, you must also have an effective
  483.    means of flow control enabled between C-Kermit and the modem,
  484.    preferably hardware (RTS/CTS) flow control. On platforms that do not
  485.    support hardware flow control, it is usually possible to select
  486.    software flow control (Xon/Xoff), and C-Kermit will do its best to set
  487.    the modem for local Xon/Xoff flow control too (but then, of course,
  488.    Ctrl-S and Ctrl-Q characters can not be transmitted on the
  489.    connection).
  490.    
  491.    If you are having trouble dialing your modem, SET DIAL DISPLAY ON to
  492.    watch the dialing interactions between C-Kermit and your modem.
  493.    Consult Chapters 3-4 of [47]Using C-Kermit (2nd Ed) for modem-dialing
  494.    troubleshooting instructions. The following sections offer some
  495.    addtional hints and tips.
  496.    
  497.   6.1. Syntax
  498.   
  499.    If you want to dial a number that starts with #, you'll need to quote
  500.    the "#" character (as \# or \{35}), since it is also a comment
  501.    introducer:
  502.    
  503.   C-Kermit>dial #98765421-1-212-5551212   ; Looks like a comment
  504.   ?You must specify a number to dial
  505.   C-Kermit>dial \#98765421-1-212-5551212  ; Works OK
  506.   C-Kermit>dial =#98765421-1-212-5551212  ; This works too
  507.  
  508.    When using a dialing directory, remember what happens if a name is not
  509.    found:
  510.    
  511.   C-Kermit>dial xyzcorp
  512.   Lookup: "xyzcorp" - not found - dialing as given
  513.  
  514.    This normally does no harm, but some modems might behave strangely
  515.    when given dial strings that contain certain letters. For example, a
  516.    certain German modem treats any dial string that contains the letter
  517.    "s" as a command to fetch a number from its internal list, and replies
  518.    OK to the ATD command, which is normally not a valid response except
  519.    for partial dialing. To avoid this situation, use:
  520.    
  521.   lookup xyzcorp
  522.   if success dial
  523.  
  524.   6.2. The Carrier Signal
  525.   
  526.    Remember: In many C-Kermit implementations (depending on the
  527.    underlying operating system -- mostly Windows, OS/2, and
  528.    System-V-based UNIX versions, and in C-Kermit 7.0, also VMS), you
  529.    can't CONNECT to a modem and type the modem's dialing command (like
  530.    "ATDT7654321") manually, unless you first tell C-Kermit to:
  531.    
  532.   SET CARRIER-WATCH OFF
  533.  
  534.    This is because (in these implementations), the CONNECT command
  535.    requires the modem's Carrier Detect (CD) signal to be on, but the CD
  536.    signal doesn't come on until after dialing is complete. This
  537.    requirement is what allows C-Kermit to pop back to its prompt
  538.    automatically when the connection is hung up. See the description of
  539.    SET CARRIER-WATCH in "Using C-Kermit".
  540.    
  541.    Similarly, if your dialed connection drops when CARRIER-WATCH is set
  542.    to AUTO or ON, you can't CONNECT back to the (now disconnected) screen
  543.    to see what might have happened unless you first SET CARRIER-WATCH
  544.    OFF. But sometimes not even SET CARRIER-WATCH OFF will help in this
  545.    situation: certain platforms (for example Unixware 2.1), once carrier
  546.    drops, won't let the application do i/o with the device any more. In
  547.    that case, if you want to use the device again, you have to CLOSE it
  548.    and OPEN it again. Or you can have Kermit do this for you
  549.    automatically by telling it to SET CLOSE-ON-DISCONNECT ON.
  550.    
  551.   6.3. Dialing and Flow Control
  552.   
  553.    Don't SET FLOW RTS/CTS if your modem is turned off, or if it is not
  554.    presenting the CTS signal. Otherwise, the serial device driver can get
  555.    stuck waiting for this signal to appear.
  556.    
  557.    Most modern modems support RTS/CTS (if they support any hardware flow
  558.    control at all), but some computers use different RS-232 circuits for
  559.    the same purposes, e.g. DTR and CD, or DTR and CTS. In such cases, you
  560.    might be able to make your computer work with your modem by
  561.    appropriately cross-wiring the circuits in the cable connector, for
  562.    example the computer's DTR to the modem's RTS, and modem's CD to the
  563.    computer's CTS. HOWEVER, C-Kermit does not know you have done this. So
  564.    if you have (say) SET FLOW DTR/CD, C-Kermit will make no attempt to
  565.    tell the modem to use RTS/CTS. You probably did this yourself when you
  566.    configured the modem.
  567.    
  568.   6.4. The Dial Timeout
  569.   
  570.    If it takes your call longer to be completed than the timeout interval
  571.    that C-Kermit calculates, you can use the SET DIAL TIMEOUT command to
  572.    override C-Kermit's value. But beware: the modem has its own timeout
  573.    for completing the call. If it is a Hayes-like modem, C-Kermit adjusts
  574.    the modem's value too by setting register S7. But the maximum value
  575.    for S7 might be smaller than the time you need! In that case, C-Kermit
  576.    sets S7 to 0, 255, or other (modem-specific) value to signify "no
  577.    timeout". If Kermit attempts to set register S7 to a value higher than
  578.    your modem's maximum, the modem will say "ERROR" and you will get a
  579.    "Failure to initialize modem" error. In that case, use SET DIAL
  580.    TIMEOUT to override C-Kermit's calculation of the timeout value with
  581.    the highest value that is legal for your modem, e.g. 60.
  582.    
  583.   6.5. Escape Sequence Guard Time
  584.   
  585.    A "TIES" (Time-Independent Escape Sequence) modem does not require any
  586.    guard time around its escape sequence. The following text:
  587.    
  588.   +++ATH0
  589.  
  590.    if sent through a TIES modem, for example because you were uploading
  591.    this file through it, could pop the modem back into command mode and
  592.    make it hang up the connection. Later versions of the Telebit T1600
  593.    and T3000 (version LA3.01E firmware and later), and all WorldBlazers,
  594.    use TIES.
  595.    
  596.    Although the probability of "+++" appearing in a Kermit packet is
  597.    markedly lower than with most other protocols (see the [48]File
  598.    Transfer section below), it can still happen under certain
  599.    circumstances. It can also happen when using C-Kermit's TRANSMIT
  600.    command. If you are using a Telebit TIES modem, you can change the
  601.    modem's escape sequence to an otherwise little-used control character
  602.    such as Ctrl-_ (Control-Underscore):
  603.    
  604.   AT S2=31
  605.  
  606.    A sequence of three consecutive Ctrl-_ characters will not appear in a
  607.    Kermit packet unless you go to extraordinary lengths to defeat more
  608.    than a few of Kermit's built-in safety mechanisms. And if you do this,
  609.    then you should also turn off the modem's escape-sequence recognition
  610.    altogether:
  611.    
  612.   AT S48=0 S2=255
  613.  
  614.    But when escape sequence recognition is turned off, "modem hangup"
  615.    (<pause>+++<pause>ATH0<CR>) will not work, so you should also SET
  616.    MODEM HANGUP RS232-SIGNAL (rather then MODEM-COMMAND).
  617.    
  618.   6.6. Adaptive Dialing
  619.   
  620.    Some modems have a feature called adaptive dialing. When they are told
  621.    to dial a number using Tone dialing, they check to make sure that
  622.    dialtone has gone away after dialing the first digit. If it has not,
  623.    the modem assumes the phone line does not accept Tone dialing and so
  624.    switches to Pulse. When dialing out from a PBX, there is almost always
  625.    a secondary dialtone. Typically you take the phone off-hook, get the
  626.    PBX dialtone, dial "9" to get an outside line, and then get the phone
  627.    company's dialtone. In a situation like this, you need to tell the
  628.    modem to expect the secondary dialtone. On Hayes and compatible
  629.    modems, this is done by putting a "W" in the dial string at the
  630.    appropriate place. For example, to dial 9 for an outside line, and
  631.    then 7654321, use ATDT9W7654321:
  632.    
  633.   SET PBX-OUTSIDE-PREFIX 9W
  634.  
  635.    (replace "9" with whatever your PBX's outside-line prefix is).
  636.    
  637.   6.7. The Busy Signal
  638.   
  639.    Some phone companies are eliminating the busy signal. Instead, they
  640.    issue a voice message such as "press 1 to automatically redial until
  641.    the number answers, or...". Obviously this is a disaster for modem
  642.    calls. If your service has this feature, there's nothing Kermit can do
  643.    about it. Your modem will respond with NO CARRIER (after a long time)
  644.    rather than BUSY (immediately), and Kermit will declare the call a
  645.    failure, rather than trying to redial the same number.
  646.    
  647.   6.8. Hanging Up
  648.   
  649.    There are two ways to hang up a modem: by turning off the serial
  650.    port's DTR signal (SET MODEM HANGUP-METHOD RS232-SIGNAL) or sending
  651.    the modem its escape sequence followed by its hangup command (SET
  652.    MODEM HANGUP-METHOD MODEM-COMMAND). If one doesn't work, try the
  653.    other. If the automatic hangup performed at the beginning of a DIAL
  654.    command causes trouble, then SET DIAL HANGUP OFF.
  655.    
  656.    The HANGUP command has no effect when C-Kermit is in remote mode. This
  657.    is on purpose. If C-Kermit could hang up its own controlling terminal,
  658.    this would (a) most likely leave behind zombie processes, and (b) pose
  659.    a security risk.
  660.    
  661.    If you DIAL a modem, disconnect, then SET HOST or TELNET, and then
  662.    HANGUP, Kermit sends the modem's hangup command, such as "+++ATHO".
  663.    There is no good way to avoid this, because this case can't reliably
  664.    be distinguished from the case in which the user does SET HOST
  665.    terminal-server, SET MODEM TYPE name, DIAL. In both cases we have a
  666.    valid modem type selected and we have a network connection. If you
  667.    want to DIAL and then later make a regular network connection, you
  668.    will have to SET MODEM TYPE NONE or SET DIAL HANGUP OFF to avoid this
  669.    phenomenon.
  670.     ________________________________________________________________________
  671.   
  672.   7. TERMINAL SERVERS
  673.   
  674.    [ [49]Top ] [ [50]Contents ] [ [51]Next ] [ [52]Previous ]
  675.    
  676.    Watch out for terminal server's escape character -- usually a control
  677.    character such as Ctrl-Circumflex (Ctrl-^). Don't unprefix it in
  678.    Kermit!
  679.    
  680.    Ciscos -- must often be told to "terminal download"... Cisco ASM
  681.    models don't have hardware flow control in both directions.
  682.    
  683.    Many terminal servers only give you a 7-bit connection, so if you
  684.    can't make it 8-bit, tell Kermit to "set parity space".
  685.    
  686.    The following story, regarding trouble transferring 8-bit files
  687.    through a reverse terminal server, was contributed by an Annex
  688.    terminal server user:
  689.    
  690.      Using C-Kermit on an HP 9000 712/80 running the HP-UX 10.0
  691.      operating system. The HP was connected to a Xylogics Annex
  692.      MICRO-ELS-UX R7.1 8 port terminal server via ethernet. On the
  693.      second port of the terminal server is an AT&T Paradyne 3810 modem,
  694.      which is connected to a telephone line. There is a program which
  695.      runs on the HP to establish a Telnet connection between a serial
  696.      line on the Annex and a character special file on the HP (/dev
  697.      file). This is an Annex specific program called rtelnet (reverse
  698.      telnet) and is provided with the terminal server software. The
  699.      rtelnet utility runs on top of the pseudo-terminal facility
  700.      provided by UNIX. It creates host-originiated connections to
  701.      devices attached ot Annex serial ports. There are several command
  702.      line arguments to be specified with this program: the IP address of
  703.      the terminal server, the number of the port to attach to, and the
  704.      name of the pseudo-device to create. In addition to these there are
  705.      options to tell rtelnet how to operate on the connect: -b requests
  706.      negotiation for Telnet binary mode, -d turns on socket-leve
  707.      debugging, -f enables "connect on the fly" mode, -r removes the
  708.      device-name if it already exists, etc. The most important of these
  709.      to be specified when using 8 data bits and no parity, as we found
  710.      out, was the -t option. This creates a transparent TCP connection
  711.      to the terminal server. Again, what we assumed to be happening was
  712.      that the rtelnet program encountered a character sequence special
  713.      to itself and then "eating" those kermit packets. I think this is
  714.      all of the information I can give you on the configuration, short
  715.      of the values associated with the port on the terminal server.
  716.      
  717.    How to DIAL from a TCP/IP reverse terminal server (modem server):
  718.    
  719.     1. (only if necessary) SET TELNET ECHO REMOTE
  720.     2. SET HOST terminal-server-ip-name-or-address [ port ]
  721.     3. SET MODEM TYPE modem-type
  722.     4. (only if necessary) SET DIAL HANGUP OFF
  723.     5. (for troubleshooting) SET DIAL DISPLAY ON
  724.     6. DIAL phone-number
  725.        
  726.    The order is important: SET HOST before SET MODEM TYPE. Since this is
  727.    a Telnet connection, serial-port related commands such as SET SPEED,
  728.    SET STOP-BITS, HANGUP (when MODEM HANGUP-METHOD is RS232), etc, have
  729.    no effect. However, in C-Kermit 8.0, if the modem server supports
  730.    [53]RFC-2217 Telnet Com-Port Control protocol, these commands do
  731.    indeed take effect at the server's serial port.
  732.     ________________________________________________________________________
  733.   
  734.   8. TERMINAL EMULATION
  735.   
  736.    [ [54]Top ] [ [55]Contents ] [ [56]Next ] [ [57]Previous ]
  737.    
  738.    Except for the Windows, OS/2, and Macintosh versions, C-Kermit does
  739.    not emulate any kind of terminal. Rather, it acts as a
  740.    "semitransparent pipe", passing the characters you type during a
  741.    CONNECT session to the remote host, and sending the characters
  742.    received from the remote host to your screen. Whatever is controlling
  743.    your keyboard and screen provides the specific terminal emulation: a
  744.    real terminal, a PC running a terminal emulator, etc, or (in the case
  745.    of a self-contained workstation) your console driver, a terminal
  746.    window, xterm, etc.
  747.    
  748.    Kermit is semitrantsparent rather than fully transparent in the
  749.    following ways:
  750.    
  751.      * During a TELNET ("set host") session, C-Kermit itself executes the
  752.        TELNET protocol and performs TELNET negotiations. (But it does not
  753.        perform TN3270 protocol or any other type of 3270 terminal
  754.        emulation.)
  755.      * If you have changed your keyboard mapping using SET KEY, C-Kermit
  756.        replaces the characters you type with the characters or strings
  757.        they are mapped to.
  758.      * If you SET your TERMINAL CHARACTER-SET to anything but
  759.        TRANSPARENT, C-Kermit translates your keystrokes (after applying
  760.        any SET KEY definitions) before transmitting them, and translates
  761.        received characters before showing them on your screen.
  762.      * If your remote and/or local TERMINAL CHARACTER-SET is an ISO 646
  763.        7-bit national character set, such as German, French, Italian,
  764.        Swedish, etc, or Short KOI used for Cyrillic, C-Kermit's CONNECT
  765.        command automatically skips over ANSI escape sequences to avoid
  766.        translating their characters. Only ANSI/ISO standard
  767.        (VT100/200/300-like) 7-bit escape sequence formats are supported
  768.        for this purpose, no proprietary schemes like H-P, Televideo,
  769.        Tektronix, etc.
  770.      * If your version of C-Kermit includes SET TERMINAL APC command,
  771.        then C-Kermit's CONNECT command will handle APC escape sequences
  772.        if TERMINAL APC is not set to OFF (which is the default).
  773.        
  774.    You can make C-Kermit fully transparent by starting it with the -0
  775.    (dash zero) command-line option.
  776.    
  777.    If you are running C-Kermit under a console driver, or in a terminal
  778.    window, that emulates the VT100, and use C-Kermit to log in to a VMS
  779.    system, the console driver or terminal window (not Kermit) is supposed
  780.    to reply to the "what are you?" query (ESC Z) from the VAX. If it
  781.    doesn't, and you can't make it do so, then you can (a) live with the
  782.    "unknown terminal" problem; (b) tell VMS to SET TERMINAL/DEVICE=VT100;
  783.    (c) program a key using SET KEY to send the appropriate sequence and
  784.    then punch the key at the right time; or (d) use the VMSLOGIN macro
  785.    that is defined in CKERMIT.INI to do this for you automatically.
  786.    
  787.    SET SESSION-LOG { TEXT, BINARY }, which is effective in UNIX and
  788.    AOS/VS but not other C-Kermit versions, removes CR, DEL, NUL, XON, and
  789.    XOFF characters (Using C-Kermit neglects to mention that XON and XOFF
  790.    are removed). The TEXT-mode setting is ineffective during SCRIPT
  791.    command execution, as well as on X.25 connections.
  792.     ________________________________________________________________________
  793.   
  794.   9. KEY MAPPING
  795.   
  796.    [ [58]Top ] [ [59]Contents ] [ [60]Next ] [ [61]Previous ]
  797.    
  798.    Except in the terminal-emulating versions, C-Kermit's key mapping
  799.    facilities are limited to normal "ASCII" keys, and cannot be used with
  800.    function keys, arrow keys, arcane key combinations, etc. Since
  801.    C-Kermit runs on such a wide variety of hardware platforms (including,
  802.    for example, more than 360 different UNIX platforms), it is not
  803.    possible for C-Kermit to support every conceivable keyboard under
  804.    every release of every UNIX (or VMS, or ...) product on every
  805.    different kind of computer possibly under all manner of different
  806.    console drivers, even if it had the means to do so.
  807.    
  808.    In technical terms, C-Kermit uses the read() function to read
  809.    keystrokes, and read() returns a single byte (value 0 through 255).
  810.    C-Kermit's SET KEY function applies to these single-byte codes.
  811.    "Extended function" keys, such as F-keys, arrow keys, etc, usually
  812.    return either a 2-byte "scan code" or else a character string (such as
  813.    an escape sequence like "<ESC> O p"). In both cases, C-Kermit has no
  814.    way to tell the difference between such multibyte key values, and the
  815.    corresponding series of single-byte key values. This could only be
  816.    done by accessing the keyboard at a much lower level in a highly
  817.    platform-dependent manner, probably requiring tens of thousands of
  818.    lines of code to support even a sampling of the most popular
  819.    workstation / OS combinations.
  820.    
  821.    However, most workstation console drivers (terminal emulation windows,
  822.    etc) include their own key-mapping facility. For example, on an IBM
  823.    RS/6000, the AIXterm program (in whose window you would run C-Kermit)
  824.    allows rebinding of the F1-F12 keys to arbitrary strings. The same
  825.    might or might not be true of DECterm windows, Sun "vttool" or
  826.    "crttool" windows, etc. Consult the technical documentation for your
  827.    workstation or emulator. See sample Xterm (Xmodmap) mappings in the
  828.    [62]Unix C-Kermit Hints and Tips document.
  829.    
  830.    The SET KEY command (except in Kermit 95) does not allow a key
  831.    definition to be (or contain) the NUL (\0) character.
  832.     ________________________________________________________________________
  833.   
  834.   10. FILE TRANSFER
  835.   
  836.    [ [63]Top ] [ [64]Contents ] [ [65]Next ] [ [66]Previous ]
  837.    
  838.    C-Kermit 7.0 is the first release of C-Kermit to use fast (rather than
  839.    robust and therefore slow) protocol defaults: long packets, sliding
  840.    windows, control-character unprefixing, and streaming where possible.
  841.    This makes most transfers (partner willing) dramatically faster "out
  842.    of the box" but might break some combinations that worked before. If
  843.    transfers with C-Kermit 7.0 or later fail where transfers worked with
  844.    earlier C-Kermit versions, try the following (one at a time, in this
  845.    order):
  846.    
  847.     1. SET PREFIXING ALL: Disables control-character unprefixing.
  848.     2. SET STREAMING OFF: Disables streaming.
  849.     3. CAUTIOUS: Selects medium but cautious protocol settings.
  850.     4. ROBUST: this command reverts to the most conservative protocol
  851.        settings.
  852.        
  853.    Execution of multiple file transfers by C-Kermit from a command file
  854.    when in remote mode might exhibit long delays between each transfer.
  855.    To avoid this, just include the command "SET DELAY 0" in your command
  856.    file before any of the file-transfer commands.
  857.    
  858.    File transfer failures can occur for all sorts of reasons, most of
  859.    them listed in Chapter 10 of [67]Using C-Kermit. The following
  860.    sections touch on some that aren't.
  861.    
  862.    The [68]C-Kermit 7.0 Release Notes document SEND /COMMAND as taking an
  863.    argument, but it doesn't. Instead of SEND /COMMAND:{some command},
  864.    use: SEND /COMMAND [ other switches ] some command.
  865.    
  866.   10.1. Laptops
  867.   
  868.    Watch out for laptops and their assorted power-saver features; for
  869.    example, a built-in modem's "auto timeout delay" hanging up the
  870.    connection in the middle of a file transfer. Most modems, even if they
  871.    have this feature, do not have it enabled by default. But if you
  872.    experience otherwise inexplicable disconnections in the midst of your
  873.    Kermit sessions, check the modem manual for such things as "idle
  874.    timeout", "auto timeout", etc, and add the command to disable this
  875.    feature to Kermit's init string for this modem.
  876.    
  877.   10.2. NFS
  878.   
  879.    If uploading a large file to an NFS-mounted disk fails (or is
  880.    painfully slow), try uploading it to a local disk (e.g. /tmp on Unix)
  881.    and then copying to the NFS disk later.
  882.    
  883.   10.3. Modems
  884.   
  885.    If you are dialing out and find that downloads work but uploads don't,
  886.    try again with a lower serial-port speed. Case in point: dialing out
  887.    on a certain PC from Linux at 115200 bps using a USR Courier 56K
  888.    "V.Everything" external modem and RTS/CTS flow control. Downloads
  889.    worked flawlessly, uploads stopped dead after the first few packets
  890.    were sent. The modem lights showed constant retraining (ARQ light
  891.    blinks slowly), and the CTS light was off 95% of the time, allowing
  892.    nothing to get through. Reducing the serial port speed to 57600 bps
  893.    made the problems go away. Evidently the PC in question has a very
  894.    fast serial port, since dialing the same modem with a different PC at
  895.    115200 bps works without incident.
  896.    
  897.   10.4. TCP/IP Connections
  898.   
  899.    If you have trouble transferring files over a TCP/IP connection, tell
  900.    Kermit to SET PARITY SPACE and try again. If that doesn't work, also
  901.    try a shorter packet length or smaller window size (to compensate for
  902.    certain well-known broken Telnet servers), and/or SET RELIABLE OFF.
  903.    
  904.   10.5. Multihop Connections
  905.   
  906.    If you have a multihop connection, with the interior nodes in CONNECT
  907.    mode (Kermit, Telnet, Rlogin, or any other), you can expect (a) file
  908.    transfer to be slower, and (b) the connection to be less transparent
  909.    (to control characters, perhaps to the 8th bit) than a more direct
  910.    connection. C-Kermit 7.0 and later have a "-0" (dash-zero)
  911.    command-line option to make it 100% transparent in cases where it is
  912.    to be used in the middle.
  913.    
  914.   10.6. Recovery
  915.   
  916.    The recovery feature (RESEND command) that was added in version
  917.    5A(190) works only for binary-mode transfers. In order for this
  918.    feature to be useful at all, the default for SET FILE INCOMPLETE was
  919.    changed from DISCARD to KEEP. Otherwise an interrupted transfer would
  920.    leave no partial file behind unless you had remembered to change the
  921.    default. But now you have to pay closer attention to Kermit's messages
  922.    to know whether a transfer succeeded or failed -- previously, if it
  923.    failed, the file would not show up on the receiving end at all; in
  924.    5A(190) and later, you'll get a partial file which could easily be
  925.    mistaken for the complete file unless you change the default back to
  926.    DISCARD or read the screen messages, or keep a transaction log.
  927.    
  928.   10.7. Filename Collisions
  929.   
  930.    SET FILE COLLISION BACKUP is the default. This means:
  931.    
  932.      * If you send the same file lots of times, there will be many backup
  933.        files. There is no automatic mechanism within Kermit to delete
  934.        them, no notion of a "version retention count", etc, but you can
  935.        use the PURGE command to clean them up.
  936.      * If a file arrives that has the same name as a directory, the file
  937.        transfer fails because Kermit will not rename a directory. Send
  938.        the file with another name, or use SET FILE COLLISION RENAME.
  939.      * If the directory lacks write permission, the file transfer fails
  940.        even if you have write access to the file that is being backed up;
  941.        in that case, switch to SET FILE COLLISION OVERWRITE or APPEND, or
  942.        send to a different directory.
  943.        
  944.    SET FILE COLLISION UPDATE depends on the date/time stamp in the
  945.    attribute packet. However, this is recorded in local time, not
  946.    Universal Time (GMT), and there is no indication of time zone. The
  947.    time is expressed to the precision of 1 second, but some file systems
  948.    do not record with this precision -- for example, MS-DOS records the
  949.    file date/time only to the nearest 2 seconds. This might cause update
  950.    operations to send more files than necessary.
  951.    
  952.    (This paragraph does NOT apply to UNIX, where, as of C-Kermit 7.0,
  953.    C-Kermit pipes incoming mail and print material directly the mail or
  954.    print program): When C-Kermit is receiving files from another Kermit
  955.    program that has been given the MAIL or REMOTE PRINT command, C-Kermit
  956.    follows the current filename collision action. This can be
  957.    disconcerting if the action was (for example) BACKUP, because the
  958.    existing file will be renamed, and the new file will be mailed (or
  959.    printed) and then deleted. Kermit cannot temporarily change to RENAME
  960.    because the file collision action occurs when the filename packet is
  961.    received, and the PRINT or MAIL disposition only comes later, in the
  962.    Attribute packet.
  963.    
  964.    Watch out for SET FILE COLLISION RENAME, especially when used in
  965.    conjunction with recovery. Recall that this option (which is NOT the
  966.    default) renames the incoming file if a file already exists with the
  967.    same name (the default is to rename the previously existing file, and
  968.    store the incoming file with its own name). It is strongly recommended
  969.    that you do not use SET FILE COLLISION RENAME if you ever intend to
  970.    use the recovery feature:
  971.    
  972.      * When the file is first received by C-Kermit, its name is changed
  973.        if another file already has the same name. When you RESEND the
  974.        same file after a failure, C-Kermit will probably try to append
  975.        the re-sent portion to the wrong file.
  976.      * Assuming that you get RESEND to work with FILE COLLISION RENAME,
  977.        C-Kermit, when receiving the remainder of the file during a RESEND
  978.        operation, will report back the wrong name. Nothing can be done
  979.        about this because the name is reported back before the receiving
  980.        Kermit program finds out that it is a recovery operation.
  981.        
  982.    Also watch out for DISABLE DELETE, since this implicitly sets FILE
  983.    COLLISION to RENAME. And note tht DELETE is DISABLEd automatically any
  984.    time you Kermit is in local mode (i.e. it makes a connection). Also
  985.    note that for purposes of DISABLE and ENABLE, "set host *" connections
  986.    do not count as local mode even though, strictly speaking, they are.
  987.    
  988.   10.8. DOS Pathnames
  989.   
  990.    When referring to foreign MS-DOS, Windows, Atari ST, OS/2, or other
  991.    file specifications that contain backslash characters in a C-Kermit
  992.    command, you might have to double each backslash, for example:
  993.    
  994.   C-Kermit>get c:\\directory\\foo.txt
  995.  
  996.    This is because backslash is used in C-Kermit commands for introducing
  997.    special character codes, variables, functions, etc.
  998.    
  999.   10.9. Cancellation
  1000.   
  1001.    If attempting to cancel local-mode file reception at a very early
  1002.    stage (i.e. before data packets are exchanged) with X or Z does not
  1003.    work, use E or Ctrl-C instead, or wait until the first data packets
  1004.    are sent.
  1005.    
  1006.    If you cancel a transfer that is underway using X or Z, and a lot of
  1007.    window slots are in use, it might take a while for the cancellation to
  1008.    take effect, especially if you do this on the receiving end; that's
  1009.    because a lot of packets might already be on their way to you. In that
  1010.    case, just be patient and let Kermit "drain" them.
  1011.    
  1012.    If C-Kermit is sending a file, remote-mode packet-mode breakout (three
  1013.    consecutive Ctrl-C's by default) is not effective until after C-Kermit
  1014.    sends its first packet. If C-Kermit is receiving a file or is in
  1015.    server mode, it is effective right away. In the former case, the SET
  1016.    DELAY value determines the earliest time at which you can break out of
  1017.    packet mode.
  1018.    
  1019.   10.10. Partner Peculiarities
  1020.   
  1021.    When using C-Kermit to transfer files with the HP48SX calculator, you
  1022.    must SET FLOW NONE. The HP48SX does not support flow control, and
  1023.    evidently also becomes confused if you attempt to use it. You might
  1024.    also need to use SET SEND PAUSE 100 (or other number). For greater
  1025.    detail about transferring files the the HP-48, see:
  1026.    
  1027.   [69]http://www.columbia.edu/kermit/hp48.html
  1028.  
  1029.    Some communication programs have errors in their implementation of
  1030.    Kermit attribute packets. If you get an error message from your
  1031.    communication program like "Attribute error", tell C-Kermit to SET
  1032.    ATTRIBUTES OFF. Better yet, switch to a real Kermit program.
  1033.    
  1034.    Some communication software claims to implement Kermit sliding
  1035.    windows, but does so incorrectly. If sliding window transfers fail,
  1036.    set C-Kermit's window size to the smallest one that works, for
  1037.    example, SET WINDOW 1.
  1038.    
  1039.    The UNIX version of C-Kermit discards carriage returns when receiving
  1040.    files in text mode. Thus, "bare" carriage returns (sometimes used to
  1041.    achieve overstriking) are lost.
  1042.     ________________________________________________________________________
  1043.   
  1044.   11. SCRIPT PROGRAMMING
  1045.   
  1046.    [ [70]Top ] [ [71]Contents ] [ [72]Previous ]
  1047.    
  1048.   11.1. Comments Versus the SCRIPT Command
  1049.   
  1050.    Remember that ";" and "#" introduce comments when (a) they are the
  1051.    first character on the line, or (b) they are preceded by at least one
  1052.    blank or tab within a line. Thus constructions like:
  1053.    
  1054.   INPUT 5 ;
  1055.   SCRIPT ~0 #--#--#
  1056.  
  1057.    must be coded using backslash notation to keep the data from being
  1058.    ignored:
  1059.    
  1060.   INPUT 5 \59                   ; 59 is the decimal ASCII code for ";"
  1061.   SCRIPT ~0 \35--#--#           ; 43 is the decimal ASCII code for "#"
  1062.  
  1063.    or, more simply:
  1064.    
  1065.   INPUT 5 \;                    ; Just quote the semicolon
  1066.   SCRIPT ~0 \#--#--#            ; Just quote the "#"
  1067.     ________________________________________________________________________
  1068.   
  1069.   11.2. Alphabetic Case and the INPUT Command
  1070.   
  1071.    INPUT and MINPUT caseless string comparisons do not work for non-ASCII
  1072.    (international) characters. Workaround: SET INPUT CASE OBSERVE. Even
  1073.    then, the "lexically less than" and "lexically greater than"
  1074.    operations (IF LLT, IF LGT) probably won't work as expected. The same
  1075.    is true for the case-conversion functions \Flower() and \Fupper().
  1076.    C-Kermit does not know the collating sequence for different character
  1077.    sets and languages. (On the other hand, it might work depending on
  1078.    such items as how Kermit was linked, whether your operating supports
  1079.    "locales", etc)
  1080.     ________________________________________________________________________
  1081.   
  1082.   11.3. NUL (0) Characters in C-Kermit Commands
  1083.   
  1084.    You can't include a NUL character (\0) in C-Kermit command text
  1085.    without terminating the character string in which it appears. For
  1086.    example:
  1087.    
  1088.   echo In these brackets [\0] is a NUL
  1089.  
  1090.    will echo "In these brackets [". This applies to ECHO, INPUT, OUTPUT,
  1091.    and all other commands (but you can represent NUL by "\N" in an OUTPUT
  1092.    string). This is because C-language strings are terminated internally
  1093.    by the NUL character, and it allows all of C-Kermit's string
  1094.    comparison and manipulation functions to work in the normal "C" way.
  1095.    
  1096.    To illustrate:
  1097.    
  1098.   INPUT 5 \0
  1099.  
  1100.    is equivalent to:
  1101.    
  1102.   INPUT 5
  1103.  
  1104.    and:
  1105.    
  1106.   INPUT 5 ABC\0DEF
  1107.  
  1108.    is equivalent to:
  1109.    
  1110.   INPUT 5 ABC
  1111.  
  1112.    INPUT operations discard and ignore NUL characters that arrive from
  1113.    the communication device, meaning that they do not figure into
  1114.    matching operations (e.g. A<NUL>B matches AB); they are not deposited
  1115.    in the INPUT buffer (\v(input)); and they are not counted in
  1116.    \v(incount), with two exceptions:
  1117.    
  1118.     1. An arriving NUL character restarts the INPUT SILENCE timer.
  1119.     2. An arriving NUL character terminates the INPUT command with the
  1120.        SUCCESS condition if the INPUT command was given an empty search
  1121.        string. In this case \v(incount) is set to 1.
  1122.        
  1123.    Also, the \v(inchar) variable is null (completely empty) if the last
  1124.    INPUT character was NUL. That is, there is no way to tell only by
  1125.    looking at \v(inchar) the difference between a NUL that was INPUT and
  1126.    no INPUT at all. If the INPUT command succeeded but \v(inchar) is
  1127.    empty, then a NUL character was input. Also, \v(incount) will be set
  1128.    to 1.
  1129.    
  1130.    \v(incount) and \v(inchar) are NOT affected by the CLEAR command.
  1131.     ________________________________________________________________________
  1132.   
  1133.   11.4. \ffiles() and \fnextfile() Peculiarities
  1134.   
  1135.    The following script program:
  1136.    
  1137.   for \%i 1 \ffiles(oofa.*) 1 {
  1138.       send \fnextfile()
  1139.   }
  1140.  
  1141.    did not work as expected in C-Kermit 6.0 and earlier but does work in
  1142.    C-Kermit 7.0 and later.
  1143.     ________________________________________________________________________
  1144.   
  1145.   11.5. Commands That Have Only Local Effect
  1146.   
  1147.    Certain settings are local to each command level, meaning that
  1148.    subordinate command levels (macros or command files) can change them
  1149.    without affecting their values at higher command levels. When a new
  1150.    command level is invoked, the value is inherited from the previous
  1151.    level. These settings are:
  1152.    
  1153.   CASE
  1154.   COUNT and \v(count)
  1155.   INPUT CASE
  1156.   INPUT TIMEOUT
  1157.   MACRO ERROR
  1158.   TAKE ERROR
  1159.  
  1160.    This arrangement allows CASE, TIMEOUT, and ERROR settings, which are
  1161.    used to control automatic exit from a command file or macro upon
  1162.    error, to be automatically restored when the command file or macro
  1163.    exits.
  1164.    
  1165.    The COUNT variable follows this rule too, which permits nested SET
  1166.    COUNT / IF COUNT loops, as in this example in which the inner loop
  1167.    counts down from the current COUNT value of the outer loop (try it):
  1168.    
  1169.   DEFINE INNER WHILE COUNT { WRITE SCREEN {   Inner:}, SHOW COUNT }
  1170.   SET COUNT 5
  1171.   WHILE COUNT { WRITE SCREEN Outer:, SHOW COUNT, DO INNER }
  1172.  
  1173.    Keep in mind that an inferior command level cannot manipulate the
  1174.    COUNT value held by a higher level. For example:
  1175.    
  1176.   DEFINE OOFA SHOW COUNT, IF COUNT GOTO LOOP
  1177.   SET COUNT 5
  1178.   :LOOP
  1179.   OOFA
  1180.   ECHO Done
  1181.  
  1182.    results in an infinite loop; the COUNT value remains at 5 because it
  1183.    is never decremented at the same level at which it was set.
  1184.     ________________________________________________________________________
  1185.   
  1186.   11.6. Literal Braces in Function Calls
  1187.   
  1188.    Since braces are used in function calls to indicate grouping, there is
  1189.    no way to pass literal braces to the function itself. Solution: Define
  1190.    a variable containing the string that has braces. Example:
  1191.    
  1192.   define \%a ab{cd
  1193.   echo \fsubstring(\%a)
  1194.   ab{cd
  1195.  
  1196.    If the string is to start with a leading brace and end with a closing
  1197.    brace, then double braces must appear around the string (which itself
  1198.    is enclosed in braces):
  1199.    
  1200.   define \%a {{{foo}}}
  1201.   echo \fsubstring(\%a)
  1202.   {foo}
  1203.  
  1204.    This also works for any other kind of string:
  1205.    
  1206.   define \%a {{ab{cd}}
  1207.   echo \fsubstring(\%a)
  1208.   ab{cd
  1209.     ________________________________________________________________________
  1210.   
  1211.   11.7. Defining Variables on the C-Kermit Command Line
  1212.   
  1213.    To define variables on the C-Kermit command line, use the -C
  1214.    command-line option with one or more DEFINE or ASSIGN commands. Note
  1215.    that the C-Kermit command line must cope with the quoting rules of
  1216.    your shell. Examples:
  1217.    
  1218.   kermit -C "define \\%a foo, define phonenumber 7654321"
  1219.  
  1220.    In this case we follow UNIX quoting rules by doubling the backslash.
  1221.    Once C-Kermit starts, the \%a and \m(phonenumber) variables are
  1222.    defined as indicated and can be used in the normal way.
  1223.    
  1224.    In DOS or Windows or OS/2 the command would be:
  1225.    
  1226.   kermit -C "define \%%a foo, define phonenumber 7654321"
  1227.  
  1228.    Here we need to double the percent sign rather than the backslash
  1229.    because of DOS shell quoting rules.
  1230.     ________________________________________________________________________
  1231.   
  1232.   11.8. Per-Character Echo Check with the OUTPUT Command
  1233.   
  1234.    Sometimes the OUTPUT command must be used to send commands or data to
  1235.    a device in "echoplex" mode, meaning that characters must be sent one
  1236.    at a time, and the next character can not be sent until the echo from
  1237.    the previous one has been received. For example, a certain PBX might
  1238.    have this characteristic. Let's say a Kermit script is used to program
  1239.    the PBX. If characters are sent too fast, they can be lost. It would
  1240.    seem that the command:
  1241.    
  1242.   SET OUTPUT PACING milliseconds
  1243.  
  1244.    could be used to take care of this, but the pacing interval is
  1245.    constant and must be set large enough to allow even the slowest echo
  1246.    to finish. If the script is large (an actual example is 14,000 lines
  1247.    long), this can cause it to take hours longer than it needs to.
  1248.    
  1249.    Here is a macro you can use to OUTPUT a string in an Echoplex
  1250.    environment:
  1251.    
  1252.   define XOUTPUT {
  1253.       local \%c \%i
  1254.       set output pacing 0
  1255.       for \%i 1 \flen(\%*) 1 {
  1256.           asg \%c \fsubstr(\%*,\%i,1)
  1257.           output \%c
  1258.           input 2 \%c
  1259.       }
  1260.   }
  1261.  
  1262.    C-Kermit 7.0 or later is required.
  1263.    
  1264.    It sends one character at a time and then waits up to 2 seconds for
  1265.    the character to be echoed back, but continues to the next character
  1266.    as soon as the echo appears, so no time is wasted. You can add an IF
  1267.    FAIL clause after the INPUT in case you want to do something special
  1268.    about failure to detect an echo within the timeout period. Obviously
  1269.    you can also change the 2-second limit, and adjust the script in any
  1270.    other desired way.
  1271.     ________________________________________________________________________
  1272.   
  1273.   11.9. Other...
  1274.   
  1275.    Escape sequences (or any strings that contain control characters)
  1276.    can't be used as labels, GOTO targets, or SWITCH cases.
  1277.    
  1278.    [ [73]Top ] [ [74]Contents ] [ [75]C-Kermit Home ] [ [76]C-Kermit 8.0
  1279.    Overview ] [ [77]Kermit Home ]
  1280.      _________________________________________________________________
  1281.    
  1282.    C-Kermit 8.0 Unix Hints and Tips / [78]The Kermit Project /
  1283.    [79]Columbia University / [80]kermit@columbia.edu / 12 Dec 2001
  1284.  
  1285. References
  1286.  
  1287.    1. http://www.columbia.edu/kermit/
  1288.    2. http://www.columbia.edu/
  1289.    3. http://www.columbia.edu/kermit/ckcbwr.html
  1290.    4. http://www.columbia.edu/kermit/ckubwr.html
  1291.    5. http://www.columbia.edu/kermit/k95.html
  1292.    6. http://www.columbia.edu/kermit/ckermit.html
  1293.    7. http://www.columbia.edu/kermit/ck80.html
  1294.    8. http://www.columbia.edu/kermit/ckututor.html
  1295.    9. http://www.columbia.edu/kermit/ckcbwr.html#x1
  1296.   10. http://www.columbia.edu/kermit/ckcbwr.html#x2
  1297.   11. http://www.columbia.edu/kermit/ckcbwr.html#x3
  1298.   12. http://www.columbia.edu/kermit/ckcbwr.html#x4
  1299.   13. http://www.columbia.edu/kermit/ckcbwr.html#x5
  1300.   14. http://www.columbia.edu/kermit/ckcbwr.html#x6
  1301.   15. http://www.columbia.edu/kermit/ckcbwr.html#x7
  1302.   16. http://www.columbia.edu/kermit/ckcbwr.html#x8
  1303.   17. http://www.columbia.edu/kermit/ckcbwr.html#x9
  1304.   18. http://www.columbia.edu/kermit/ckcbwr.html#x10
  1305.   19. http://www.columbia.edu/kermit/ckcbwr.html#x11
  1306.   20. http://www.columbia.edu/kermit/ckcbwr.html#top
  1307.   21. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1308.   22. http://www.columbia.edu/kermit/ckcbwr.html#x2
  1309.   23. http://www.columbia.edu/kermit/ck60manual.html
  1310.   24. http://www.columbia.edu/kermit/ckermit2.html
  1311.   25. http://www.columbia.edu/kermit/ck60manual.html
  1312.   26. http://www.columbia.edu/kermit/ckcbwr.html#top
  1313.   27. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1314.   28. http://www.columbia.edu/kermit/ckcbwr.html#x3
  1315.   29. http://www.columbia.edu/kermit/ckcbwr.html#x1
  1316.   30. http://www.columbia.edu/kermit/ckcbwr.html#top
  1317.   31. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1318.   32. http://www.columbia.edu/kermit/ckcbwr.html#x4
  1319.   33. http://www.columbia.edu/kermit/ckcbwr.html#x2
  1320.   34. http://www.columbia.edu/kermit/ckcbwr.html#top
  1321.   35. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1322.   36. http://www.columbia.edu/kermit/ckcbwr.html#x5
  1323.   37. http://www.columbia.edu/kermit/ckcbwr.html#x3
  1324.   38. ftp://ftp.isi.edu/in-notes/rfc1122.txt
  1325.   39. http://www.columbia.edu/kermit/ckcbwr.html#top
  1326.   40. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1327.   41. http://www.columbia.edu/kermit/ckcbwr.html#x6
  1328.   42. http://www.columbia.edu/kermit/ckcbwr.html#x4
  1329.   43. http://www.columbia.edu/kermit/ckcbwr.html#top
  1330.   44. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1331.   45. http://www.columbia.edu/kermit/ckcbwr.html#x7
  1332.   46. http://www.columbia.edu/kermit/ckcbwr.html#x5
  1333.   47. http://www.columbia.edu/kermit/ck60manual.html
  1334.   48. http://www.columbia.edu/kermit/ckcbwr.html#x10
  1335.   49. http://www.columbia.edu/kermit/ckcbwr.html#top
  1336.   50. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1337.   51. http://www.columbia.edu/kermit/ckcbwr.html#x8
  1338.   52. http://www.columbia.edu/kermit/ckcbwr.html#x6
  1339.   53. ftp://ftp.isi.edu/in-notes/rfc2217.txt
  1340.   54. http://www.columbia.edu/kermit/ckcbwr.html#top
  1341.   55. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1342.   56. http://www.columbia.edu/kermit/ckcbwr.html#x9
  1343.   57. http://www.columbia.edu/kermit/ckcbwr.html#x7
  1344.   58. http://www.columbia.edu/kermit/ckcbwr.html#top
  1345.   59. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1346.   60. http://www.columbia.edu/kermit/ckcbwr.html#x10
  1347.   61. http://www.columbia.edu/kermit/ckcbwr.html#x8
  1348.   62. http://www.columbia.edu/kermit/ckubwr.html
  1349.   63. http://www.columbia.edu/kermit/ckcbwr.html#top
  1350.   64. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1351.   65. http://www.columbia.edu/kermit/ckcbwr.html#x11
  1352.   66. http://www.columbia.edu/kermit/ckcbwr.html#x9
  1353.   67. http://www.columbia.edu/kermit/ck60manual.html
  1354.   68. http://www.columbia.edu/kermit/ckermit70.html
  1355.   69. http://www.columbia.edu/kermit/hp48.html
  1356.   70. http://www.columbia.edu/kermit/ckcbwr.html#top
  1357.   71. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1358.   72. http://www.columbia.edu/kermit/ckcbwr.html#x10
  1359.   73. http://www.columbia.edu/kermit/ckcbwr.html#top
  1360.   74. http://www.columbia.edu/kermit/ckcbwr.html#contents
  1361.   75. http://www.columbia.edu/kermit/ckermit.html
  1362.   76. http://www.columbia.edu/kermit/ck80.html
  1363.   77. http://www.columbia.edu/kermit/index.html
  1364.   78. http://www.columbia.edu/kermit/index.html
  1365.   79. http://www.columbia.edu/
  1366.   80. mailto:kermit@columbia.edu
  1367.