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