home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ckscripts / READ.ME < prev    next >
Text File  |  2020-01-01  |  12KB  |  335 lines

  1. C-KERMIT / KERMIT 95 SCRIPTS LIBRARY
  2.  
  3. Most recent update: 8 February 2000.
  4.  
  5. The command and script language of C-Kermit and Kermit 95 is described in
  6. Using C-Kermit, 2nd Edition, as supplemented by the ckermit2.txt file.
  7.  
  8. Most of these scripts are intended to illustrate new features of C-Kermit
  9. 7.0 (released 1 Jan 2000) and K95 1.1.19.
  10.  
  11. The scripts are listed below. Those marked with (*) are "kerbang" scripts
  12. which, in UNIX, can be used exactly like shell scripts if you give them
  13. execute permission:
  14.  
  15.   chmod +x scriptname
  16.  
  17. Command-line arguments are accepted in the expected manner, e.g.:
  18.  
  19.   autotelnet xyz.com myuserid
  20.  
  21. The first line of each kerbang script looks like:
  22.  
  23.   #!/usr/local/bin/wermit +
  24.  
  25. (but without the indentation). This indicates the pathname of the C-Kermit
  26. executable that is to execute the script; change this line as needed. The
  27. trailing plus sign is required if command-line arguments are to be passed
  28. to the script (and doesn't hurt if they are not). The "kerbang" feature
  29. requires C-Kermit 7.0. For more about kerbang scripts, see ckermit2.txt,
  30. Section 7.19 (which also explains how to use them in VMS).
  31.  
  32. On non-UNIX platforms, these scripts are executed by:
  33.  
  34.   1. Giving a TAKE command to Kermit, or:
  35.  
  36.   2. Including the script filename as the first command-line argument to
  37.      the Kermit program, or:
  38.  
  39.   3. In Windows 95/98/NT/2000, by filetype association (when the script
  40.      filename has the suffix ".ksc"), but in this case Windows does not
  41.      provide a mechanism to pass arguments to the script.
  42.  
  43. Outside of UNIX, the "kerbang" line has no effect, since it is a comment to
  44. Kermit. In VMS, any references to "environment variables" can be satisfied
  45. by logical names or DCL symbols.
  46.  
  47.      These scripts are for illustrative purposes only and carry no
  48.      warranty, express or implied.
  49.  
  50.   ------------------------------------------------------------------------
  51. CONTENTS
  52.  
  53.    * C-Kermit Initialization Files
  54.    * Internet Scripts
  55.    * Modem Scripts
  56.    * Pager Scripts
  57.    * Screen-Formatting Scripts
  58.    * Screen-Scraping Scripts
  59.    * File-Transfer Scripts
  60.    * File-Management Scripts
  61.    * Number-Crunching Scripts
  62.    * Object-Oriented Programming
  63.    * Script-Language Torture Tests
  64.  
  65.   ------------------------------------------------------------------------
  66. C-Kermit Initialization Files
  67.  
  68.    * kermrc
  69.      The standard C-Kermit initialization file, slightly updated for
  70.      version 7.0. C-Kermit 6.0 or later required. Includes definitions for
  71.      the services directory with automatic login macros for various
  72.      platforms and communication methods.
  73.  
  74.    * mykermrc
  75.      Sample C-Kermit customization file. C-Kermit 6.0 or later required.
  76.  
  77. Internet Scripts:
  78.  
  79.    * autotelnet (*)
  80.      Makes an automated Telnet connection. C-Kermit 7.0 or K95 1.1.19
  81.      required.
  82.  
  83.    * autotelnet6 (*)
  84.      Makes an automated Telnet connection. Same as "autotelnet" but does
  85.      not use any new features of C-Kermit 7.0. C-Kermit 6.0 or K95 1.1.9 or
  86.      later required.
  87.  
  88.    * iksget (*)
  89.      Gets files from an Internet Kermit Service.
  90.  
  91.    * iksdpy (*)
  92.      The Internet Kermit Service Daemon realtime display monitor. C-Kermit
  93.      7.0 required.
  94.  
  95. Modem Scripts:
  96.  
  97.    * getline (*)
  98.      Given a list of serial devices usable for dialing out, finds and
  99.      assigns the first free one. C-Kermit 7.0 or K95 1.1.19 required.
  100.  
  101.    * modemtest (*)
  102.      Given a list of modem pool phone numbers, makes repeated calls to each
  103.      one; logs into a specified host, transfers files back and forth, and
  104.      keeps a logfile of connection and performance statistics. Runs in
  105.      UNIX, Windows 95/98/NT/2000, or VMS. C-Kermit 7.0 or K95 1.1.19
  106.      required.
  107.  
  108.    * dialout (*)
  109.      Puts up a form for the user to fill out to select modem type, port,
  110.      speed, and phone number, and then dials upon user command. C-Kermit
  111.      7.0 or K95 1.1.19 required. Note: This is also a screen-formatting
  112.      script.
  113.  
  114.    * callbycall
  115.      A dialing script that selects the most appropriate long-distance
  116.      provider by time of day, and that also cycles through providers upon
  117.      busy signals (in case the provider itself is busy, rather than the
  118.      destination number). For use with SET DIAL MACRO. By Peter Eichhorn,
  119.      Assyst GmbH, Mⁿnchen. C-Kermit 7.0 or K95 1.1.19 required.
  120.  
  121. Pager Scripts:
  122.  
  123.    * numpage (*)
  124.      Script for beepers or numeric pagers. C-Kermit 7.0 or K95 1.1.19
  125.      required.
  126.  
  127.    * alphapage (*)
  128.      TAP/IXO alphanumeric paging script. C-Kermit 7.0 or K95 1.1.19
  129.      required.
  130.  
  131.    * alphapage6
  132.      TAP/IXO alphanumeric paging script that can be used by C-Kermit 6.0 or
  133.      K95 1.1.13 or later.
  134.  
  135.    * More about pagers
  136.  
  137. Screen-Formatting Scripts:
  138.  
  139.    * bottom (*)
  140.      A simple one-line script that uses C-Kermit to put the cursor on the
  141.      bottom line of your screen. C-Kermit 7.0 or K95 1.1.19 required.
  142.  
  143.    * menu (*)
  144.      Skeleton of a menu application. C-Kermit 7.0 or K95 1.1.19 required.
  145.  
  146.    * Also see the dialout script, which uses screen-drawing techniques.
  147.  
  148. Screen-Scraping Scripts:
  149.  
  150.    * scrape
  151.      In Kermit 95, scripts can interact with the terminal emulator to
  152.      retrieve strings from specified locations on the terminal screen,
  153.      similar to HLLAPI. In this script, screen forms are parsed to select
  154.      and retrieve images from a database on the host computer. By Max
  155.      Evarts. K95 1.1.17 or later required.
  156.  
  157. File-Transfer Scripts:
  158.  
  159.    * deliver (*)
  160.      A script that delivers the specified file or files to their
  161.      destination, even if the connection is broken in mid-transfer.
  162.      C-Kermit 6.0 or K95 1.1.8 or later required.
  163.  
  164.    * synchronize (*)
  165.      A script that synchronizes directory trees on two Internet hosts over
  166.      a Telnet connection. Only the files that are newer on the source than
  167.      at the destination are transferred. Directories are created
  168.      automatically as needed at the destination. Files that disappeared
  169.      from the source are deleted at the destination. Any mixture of text
  170.      and binary files can be handled. The two hosts need not have the same
  171.      operating system or file system. The destination host is contacted and
  172.      logged in to automatically (so this is also an Internet script); thus
  173.      the entire operation can run unattended. C-Kermit 7.0 or K95 1.1.19
  174.      required.
  175.  
  176. File-Management Scripts:
  177.  
  178.    * rgrep (*)
  179.      Answers the frequently asked question: "Where is recursive grep?"
  180.      Searches through files in a directory tree whose names match the given
  181.      pattern and prints all lines in all files that match the given
  182.      pattern. C-Kermit 7.0 or K95 1.1.19 required.
  183.  
  184.    * rename (*)
  185.      A one-line analog to the UNIX shell "for i in *; do blah; done" loop.
  186.      C-Kermit 7.0 or K95 1.1.19 required.
  187.  
  188.    * changetype (*)
  189.      Elaboration of rename to general-purpose file-type changing script;
  190.      old and new filetypes and file list are given as command-line
  191.      arguments, e.g. "changetype hlp txt *" renames *.hlp files to *.txt.
  192.      C-Kermit 7.0 or K95 1.1.19 required.
  193.  
  194.    * delete (*)
  195.      Answers the Frequently Asked Question "How do I delete files more than
  196.      5 days old?". C-Kermit 7.0 or K95 1.1.19 required.
  197.  
  198.    * review (*)
  199.      Review files interactively. Everything you ever wanted in a text-mode
  200.      file browser. C-Kermit 7.0 or K95 1.1.19 required.
  201.  
  202.    * logrotate
  203.      Rotates connection logs on a monthly basis. C-Kermit 7.0 or K95 1.1.19
  204.      required.
  205.  
  206.    * cleandups (*)
  207.      A rather complex file-management application (used, in fact, to manage
  208.      the update and installation of C-Kermit 7.0 Beta-test binaries on our
  209.      ftp server). C-Kermit 7.0 required.
  210.  
  211.    * install (*)
  212.      Moves new C-Kermit Beta-test binaries from a staging area to the ftp
  213.      site, deleting corresponding binaries from previous Beta tests as it
  214.      goes, so as not to fill up the ftp server disk. C-Kermit 7.0 required.
  215.  
  216.    * merge (*)
  217.      Merges any number of presorted files together into a single output
  218.      file. Illustrates C-Kermit 7.0's new file i/o package operating on
  219.      multiple files at once. C-Kermit 7.0 required.
  220.  
  221.    * ftplog (*)
  222.      Analyzes a file-transfer log in wu-ftpd format, which is also created
  223.      by C-Kermit 7.0's SET TRANSACTION-LOG FTP format. Lists the five most
  224.      popular files and also prints a histogram of file count per number of
  225.      accesses. Illustrates associative arrays. C-Kermit 7.0 required.
  226.  
  227. Number-Crunching Scripts:
  228.  
  229.    * statistics (*)
  230.      Given a file in which each line contains a pair of numbers, X and Y,
  231.      computes and prints the maximum, mininum, mean, variance, and standard
  232.      deviation of the X's and Y's, and the correlation coefficient of X and
  233.      Y. The numbers in file may (but need not) have decimal points and
  234.      fractional parts. Illustrates the floating-point arithmetic features
  235.      new to C-Kermit 7.0.
  236.  
  237. Object-Oriented Programming:
  238.  
  239. (And other creative programming techniques.) This section by Dat Thuc
  240. Nguyen.
  241.  
  242.    * matrix
  243.      The matrix is an essential element in many computing areas. C-Kermit
  244.      and Kermit 95 can do matrix operations easily. This script creates two
  245.      matrices, A and B, then computes their sum: matrix C.
  246.  
  247.    * noswitch
  248.      "SWITCH Considered Harmful"
  249.  
  250.    * oop
  251.      Object-oriented programming in C-Kermit and Kermit 95. Fun with dogs
  252.      and cats.
  253.  
  254.    * complex
  255.      Complex numbers are not a built-in type of many programming languages.
  256.      Here OOP comes to rescue with the user-defined type. This script
  257.      defines a complex number class in C-Kermit, offering the familiar C++
  258.      interface. C-Kermit 7.0 required.
  259.  
  260.    * wordcount (*)
  261.      Word frequency counting is the Excel of scripting languages such as
  262.      awk and Perl. With OOP, C-Kermit also handles the task comfortably.
  263.      This script defines and uses the class Words to count the occurrences
  264.      of unique words of a plain-text text file. The class Words shields
  265.      implementation details and promotes reuse, the flagship of OOP.
  266.      C-Kermit 7.0 required.
  267.  
  268.    * inheritance
  269.      No object-oriented programming language leaves home without
  270.      inheritance. This script displays inheritance in C-Kermit and Kermit
  271.      95.
  272.  
  273.    * multiple
  274.      Multiple inheritance enriches software design. Not all OOP languages
  275.      have it: C++ does; Java and Smalltalk don't. This script implements
  276.      multiple inheritance in C-Kermit. The famous animal class found in
  277.      many C++ and Smalltalk references is used to present the subject.
  278.  
  279.    * bag
  280.      The container is a key concept in object-oriented programming.
  281.      Smalltalk, C++, etc. have standard libraries of containers. This
  282.      script defines the class 'bag' in C-Kermit/Kermit 95. Bag offers a
  283.      rich usage interface.
  284.  
  285.    * string
  286.      A rudimentary string class based on the Smalltalk model.
  287.  
  288.    * semaphore
  289.      We use semaphores to coordinate computing tasks, share resources, etc.
  290.      This script defines semaphore classes in both the Smalltalk and C++
  291.      styles. C-Kermit 6.0 / K95 1.1.17 required.
  292.  
  293.    * singleton
  294.      In the patterns community, the singleton is a class that can have only
  295.      one instance. All objects instantiated from that class refer to the
  296.      one and only singleton! The singleton is very useful where there is
  297.      only one resource available and various user-defined functions access
  298.      that resource under different refferences. The singleton class ensures
  299.      that one and only one object can be instantiated from it, though under
  300.      different names.
  301.  
  302.    * state
  303.      The finite state machine is a useful concept in many applications.
  304.      This script suggests a framework for a state machine.
  305.  
  306. Script-Language Torture Tests:
  307.  
  308.    * demo (*)
  309.      An interactive "torture test" for C-Kermit's script language. C-Kermit
  310.      7.0 or K95 1.1.19 required.
  311.  
  312.    * iftest (*)
  313.      Exerciser for compound Boolean expressions. C-Kermit 7.0 or K95 1.1.19
  314.      required.
  315.  
  316.    * functions (*)
  317.      Function exerciser. C-Kermit 7.0 or K95 1.1.19 required.
  318.  
  319.    * localarray (*)
  320.      Local array exerciser. C-Kermit 7.0 or K95 1.1.19 required.
  321.  
  322.   ------------------------------------------------------------------------
  323. Links:
  324.  
  325.    * Kermit script portability reference
  326.    * Kermit script library (top)
  327.    * Kermit home page
  328.    * C-Kermit
  329.    * C-Kermit manual
  330.    * The ckermit2.txt file
  331.    * Kermit 95
  332.  
  333.   ------------------------------------------------------------------------
  334. C-Kermit/K95 Script Library / Columbia University / 8 Feb 2000
  335.