Icon The Kermit Project   |   Now hosted by Panix.com
New York City USA   •   kermit@kermitproject.org
since 1981

Getkermitscript

    A Kermit script to download and install Kermit scripts
        [download

Author:  Frank da Cruz
Script version: 2.00
Dated: 2022-04-28
      Platform:  Any version of Unix where C-Kermit is available.
Requires:  C-Kermit 8.0.201 or later*
This page last updated: Mon Jun 5 11:43:58 2023

Getkermitscript is a program written in the Kermit script language that downloads a script from the Kermit Project script library and configures it for and installs it on your computer. As coded it runs only in Unix, but with minor adjustments probably will also run on VMS and even Windows.

Version 1 of this script (2014) used Kermit's built-in FTP client for downloading. Version 2 calls upon the external wget command because the FTP protocol itself was virtually erased from the entire Internet in 2021.

Installation

  1. CLICK HERE to download. Save it on your computer in a directory that is in your PATH, so you can execute it just by typing its name, no matter what your current directory is.

  2. Give it execute permission:

    chmod +x getkermitscript

  3. Using a text editor, replace the top line of the getkermitscript file with the full pathname of C-Kermit on your computer, with "#!" as a prefix and " +" as a suffix (space and plus-sign), with no spaces on the line except the one space before the plus sign (explain). Example:

    #!/usr/local/bin/kermit +

    (Note: you don't actually have to replace the top line, you can also simply put the new one above it.) This step is somewhat annoying but it's necessary for all scripts of any kind in Unix. The nice thing is that once you have completed this step for Getkermitscript, then Getkermitscript will perform it for you automatically on any other Kermit scripts that you download with it.

Using Getkermitscript

To download any script from the Kermit script library, type the name of this script ("getkermitscript" unless you changed it) followed by the name of the script to get, for example:
getkermitscript jpginfo
and optionally followed by the name of the directory to store it in:
getkermitscript jpginfo /usr/local/bin/scripts/
(which should normally be in your PATH). If you omit the target directory name, the script is stored in your current directory.

After the desired script file is downloaded, an appropriate top line is added to it automatically and it is given execute permission, so you should be able to run the downloaded script immediately, just by typing its name (assuming you have stored it in a directory that is in your PATH).

Note that all scripts in the Kermit script directory have lowercase ASCII names, and that they do NOT have a .ksc extension, because if they did, any attempt to download them to Windows in a Web browser would result in having the browser try to execute them rather than store them. These points can be confusing because in documentation the script names are sometimes capitalized and/or shown with .ksc extensions. Getkermitscript allows for these possibilities by automatically lowercasing the script name you give it and removing any .ksc extension.

Suppose you have downloaded 'getermitscript' and you want to use it to download some of the more popular Kermit scripts, and let's say you keep your scripts in the scripts subdirectory of your login directory:

cd ~/scripts CD to your scripts directory
getkermitscript photogallery
Get and install the Photogallery script.
getkermitscript jpginfo Get and install the jpginfo script.
getkermitscript getkermitscript Get and install a new version of the getkermitscript script.
Alternatively you could put the destination directory on the getkermitscript command line:
getkermitscript jpginfo ~/scripts/

CLICK HERE for the current list of scripts available to download.

Getkermitscript / The Kermit Project / kermit@kermitproject.org / January 2014