home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / cli / tsh911g.lzh / TSH_REF.DOC < prev   
Text File  |  1992-09-02  |  28KB  |  737 lines

  1.             TomShell Reference Manual
  2.                  October 4, 1990
  3.              last revised September 2, 1992
  4.                 Tom Clegg
  5.  
  6.  Table of Contents
  7.  -----------------
  8.   0. 0.911g new features
  9.   1. TomShell Commands
  10.     alias        dir        ls        system
  11.     author        echo        mkdir        unalias
  12.     cat        exit        mv        unset
  13.     cd        help        ren        verbatim
  14.     cls        history        rm        word
  15.     condense    input        rmdir
  16.     cp        interact    set
  17.   2. Batch file only commands
  18.     gosub        resume
  19.     goto        return
  20.     if        :label
  21.     ifv
  22.   3. Special variables
  23.     0..99        dcdwatch    keystat        quick
  24.     anygem        f        margin        resolution
  25.     cwd        f1..f20        mem        status
  26.     date        font        nolabel        time
  27.     disk        force        owrite        verbosity
  28.     dcd        key        PATH        volume
  29.     **********  NEW: pause, prompt, shortdir, width  ***********
  30.   4. Special characters
  31.     >    >>    <    $    \    #    ;    !    "
  32.   5. Explanations
  33.       .1 Batch files
  34.     .2 Errorlevels
  35.     .3 Filename completion
  36.     .4 Modes of Operation
  37.     .5 Output devices
  38.     .6 Running Programs
  39.     .7 Variables
  40.    
  41.  =======================================================================
  42.   
  43.  0. 0.911g New features (in the order in which they were added)
  44.  ----------------------
  45.  
  46.   .1    Your command history buffer (last 20 commands) is saved when you
  47.     "exit" TomShell, and reloaded the next time you run it.
  48.  
  49.   .2    A 'set font' command now has no effect in resolutions other than
  50.     ST high; this rather than crashing or generally confusing the
  51.     operating system.
  52.  
  53.   .3    '>' and '<' characters preceding filenames are ignored when
  54.         TomShell is attempting filename completion.
  55.  
  56.   .4    System and user variables are expanded with the filename-complete
  57.     (tab) key.  For example, typing "$PATH" and a <tab> will show you
  58.     the contents of your PATH variable.
  59.  
  60.   .5    The "path" variable is case-insensitive.  This is mainly because
  61.     while TomShell likes lower-case variable names, the standard name
  62.     for the PATH variable is upper-case.  So, both work.  :-)
  63.  
  64.   .6    The 'mv' (move) command will try renaming files before copying/
  65.     deleting them.  Since GEMDOS allows files to be 'renamed' into
  66.     other places on the same drive, this greatly speeds up commands
  67.     like "mv c:\fu\*.* c:\fu\bar\".
  68.  
  69.   .7    'cp' and 'mv' now work on batches of over 128 files.  They already
  70.     did, way back before cp/mv sorted their source files, but I had
  71.     a momentary logic drop, and buggered it all up.  :-)
  72.  
  73.   .8    A new system variable, 'flash', changes or disables cursor flashing.
  74.  
  75.   .9    Some internal cleanup was done, much of it in the external program
  76.     execution section.
  77.  
  78.  0.200! New features
  79.  -------------------
  80.   .1    Finally, "ls" does good columns!  The list goes down the first (left)
  81.       column, down the second column, down the third column, and so on.
  82.     This is much better for actually trying to find files.  Maybe
  83.     eventually this will be used in the "help" command as well. :-)
  84.  
  85.   .2    Two new variables have been implemented: pause and prompt.  Check
  86.     out the appropriate sections in the manual (search for "(NEW)").
  87.     I'm especially proud of "prompt".  :-)  Why are there so many
  88.     happy faces here?  :-)
  89.  
  90.   .3    Two more variables have been implemented: shortdir and width.  Again,
  91.     check for function later on.
  92.  
  93.   .4    With all these new variables, the "set" output got far too long to
  94.     be useful (on a 25-line screen, all user variables were scrolled off
  95.     the top by the system variables), so the system variables are hidden
  96.     unless a "set s" command is given.  Much nicer looking.
  97.  
  98.   .5    Small and probably unnoticed feature removed: "alias f" would do
  99.     the "set f" output but preceded by "f=    ".  Rather insignificant,
  100.     but worth fixing anyway.  :-)
  101.   
  102.  1. TomShell Commands
  103.  --------------------
  104.  alias         author        cat           cd            cls           condense
  105.  cp            dir           echo          exit          help          history
  106.  input         interact      ls            mkdir         mv            ren
  107.  rm            rmdir         set           system        unalias       unset
  108.  verbatim      word
  109.  
  110.  alias        assign a complex meaning to a simple word.
  111.  
  112.         alias jim cat d:\stadel\money    # `jim' now means `cat d:\...'
  113.         alias jim            # what is "jim" aliased as?
  114.         alias                # list all aliased words
  115.  
  116.  author        display initial message about me and my address.
  117.  
  118.         author
  119.  
  120.  cat        display a [text] file to the current output device.  Can
  121.         be redirected via >whatever
  122.  
  123.         cat file1
  124.         cat file1 file2
  125.  
  126.  cd        change current default (working) directory.  Equivalent to
  127.         "set cwd ..."
  128.  
  129.         cd e:\stadel\
  130.         cd \files\texts
  131.         cd d:\
  132.  
  133.  cls        clear the screen using the VT52 "esc E" command.  Can
  134.         be redirected via >whatever
  135.  
  136.         cls
  137.  
  138.  condense    take the spaces out of a variable's value.
  139.  
  140.         condense blah    # blah="foo bar" => blah="foobar"
  141.  
  142.  cp        copy files.  If there is more than one argument, the last
  143.         one is considered to be the destination directory or file.
  144.  
  145.         cp jimbob.doc joebob.asc      # copy jimbob to joebob
  146.         cp fubar.txt \texts\          # copy fubar.txt to \texts\
  147.         cp fubar1.txt fubar2.txt \texts\
  148.         cp fu*.doc \texts\
  149.         cp fu*.doc              # copy to current dir.
  150.         cp fubar.txt              # copy to current dir.
  151.  
  152.  dir        list files in current or given directory.  A search mask
  153.         or path may be given.  Each file is displayed on a separate
  154.         line, with its size, date, time, and status bits displayed
  155.         in neat columns along with it.  Subdirectories are denoted
  156.         by a trailing "\".
  157.  
  158.         dir            # list all files in cwd
  159.         dir \texts\        # list all files in \texts\
  160.         dir \texts\*.doc
  161.         dir *.txt *.doc g:\*.c
  162.  
  163.  echo        display the arguments to the current output device.
  164.  
  165.         echo blah        # output: blah<cr/lf>
  166.         echo            # output: <cr/lf>
  167.         echo -n blah        # output: blah
  168.         echo this is a test
  169.         echo -n this is a test
  170.         echo -n $disk;echo k    # output: (eg) 763k
  171.  
  172.  exit        exit the current batch file or interactive session.
  173.  
  174.         exit
  175.         exit 44            # sets $status to 44 and, if exiting
  176.                       TomShell completely, returns 44
  177.                       to the calling program.
  178.         (see also "system")
  179.         
  180.  
  181.  help        display a list of available commands and reserved variables.
  182.  
  183.         help
  184.  
  185.  history    display the last twenty commands entered, with line numbers.
  186.         These entries can be accessed with !# or !string (!# refers
  187.         to the line with the given number attached to it, !string
  188.         to the most recent command starting with "string").
  189.  
  190.         history
  191.  
  192.  input        take one line of text input from the current input device
  193.         and place the received text in the given variable.
  194.  
  195.         input name
  196.         input name <aux: >aux:
  197.  
  198.  interact    enter interactive mode until the command "exit" is issued.
  199.         See "Modes of Operation" below for more details.
  200.  
  201.  ls        display a short listing of files.  Sytax is the same as
  202.         "dir", but the files are listed in columns of filenames
  203.         rather than with the size, date, time, etc.
  204.  
  205.  mkdir        create a directory (folder) with the given name.
  206.  
  207.         mkdir tree
  208.         mkdir c:\blah
  209.         mkdir \test\phroo    # note: \test will not be created
  210.                     # if it doesn't already exist
  211.  
  212.  mv        identical to "cp" but, if a file is successfully copied,
  213.         the original file will be deleted.  [Starting in 0.911,]
  214.         a "rename" will be attempted on each file first, in case
  215.         GEMDOS allows it.  This speeds up same-disk file moves.
  216.  
  217.  ren        rename a file
  218.  
  219.         ren fubar.doc foobar.doc
  220.         ren jimbob \texts\    # jimbob -> \texts\jimbob
  221.         
  222.         * Note: files can be renamed to anywhere on a logical drive
  223.         without being copied or moved (renaming is faster), but
  224.         not between drives.
  225.         * Note: under TOS 1.4 or greater, folders can also be
  226.         renamed.
  227.  
  228.  rm        delete the specified file or files.
  229.  
  230.         rm fubar.txt
  231.         rm *.*
  232.         rm *.txt
  233.  
  234.  rmdir        delete the specified directory (folder)
  235.  
  236.         rmdir test
  237.         rmdir c:\temp
  238.         
  239.         * Note: trying to delete a non-empty directory will result
  240.         in an error message.
  241.  
  242.  set        change the value of a user or system variable, or, if the
  243.         variable specified does not exist, create a new variable
  244.         with the given information.
  245.  
  246.         set name Tom
  247.         set verbosity 2
  248.         set name        # display the contents of $name
  249.         set            # list all defined variables and
  250.                     # their contents
  251.         
  252.  system        exit all levels of TomShell and return to the calling
  253.         program.  Differs from "exit" in that if it is called
  254.         from a nested batch file or an "interact" system, the
  255.         system will exit completely rather than going back one
  256.         level.
  257.         
  258.         system
  259.  
  260.  unalias    remove an alias entry from the list
  261.  
  262.         unalias v
  263.  
  264.  unset        remove a variable entry from the list
  265.  
  266.         unset name
  267.  
  268.  verbatim    display a file to the console.  NOTE: This will ONLY output
  269.         to the console and cannot be redirected.  It provides the
  270.         advantage of being able to view a file containing non-ASCII
  271.         characters properly.  Any character except for <cr> and <lf>
  272.         will be output as some form of character.  Great for looking
  273.         at binary files (why?)
  274.  
  275.         verbatim tomshell.ttp
  276.  
  277.  word        truncate the given variable to only one word (everything
  278.         before the first space)
  279.         
  280.         word name    # "Tom Clegg" -> "Tom"
  281.  
  282.  
  283.  2. Batch files only
  284.  -------------------
  285.  gosub         goto          if            ifv           resume        return
  286.  :label
  287.  
  288.  gosub        branch to a given label until a "return" statement is
  289.         encountered, whereupon execution will continue from this
  290.         point
  291.         
  292.         gosub test.label
  293.  
  294.  goto        branch to a given label
  295.  
  296.         goto test.label.2
  297.         
  298.         * Note: gosub, goto, and return work just like in BASIC.
  299.  
  300.  if        conditional statement, can use "and"/"or". Just like BASIC,
  301.         but the [in]equality operators are like C (==, !=, <, >,
  302.         <=, >=)
  303.  
  304.         if <exp> and <exp> or <exp> then <cmd>
  305.         if $status >= 0 and $key == off then phroo.bat
  306.         if $status <0 or $key == on then fubar
  307.         if $status != 3 then gosub test.label.3
  308.  
  309.  ifv        simplified form of "if".
  310.  
  311.         ifv status 0 goto foo
  312.          [equivalent to:]
  313.         if $status == 0 then goto foo
  314.  
  315.  resume        reset the "stopped" flag.  The "s" key sets the flag,
  316.         and "resume" or the command prompt display resets it.
  317.         If it is set, no text is displayed unless "force" ==
  318.         "on" (see "force")
  319.  
  320.         cat 1stfile
  321.         resume        # in case 1stfile was aborted
  322.         cat 2ndfile    # this one's important!
  323.  
  324.  return        return from a subroutine.  An error results if there is
  325.         no "address" on the stack to return to (we aren't in
  326.         a subroutine).
  327.         
  328.         return
  329.  
  330.  :label        define a label that can be jumped (goto label) or
  331.         branched (gosub label) to.
  332.         
  333.         :test.label
  334.         :test.label.2
  335.  
  336.  Special variables
  337.  -----------------
  338.  0..99 ^       anygem        cwd           date ^        disk ^        dcd ^
  339.  dcdwatch      f             f1..f20       font          force         key ^
  340.  keystat ^     margin        mem ^         nolabel       owrite        PATH
  341.  quick         resolution ^  status        time ^        verbosity     volume
  342.      **********  NEW: flash, pause, prompt, shortdir, width  ***********
  343.  ^ == read only
  344.  
  345.  0..99        the arguments passed to the current batch file, or the last
  346.         one executed.  $0 is the name of the batch file, $1 is
  347.         the first argument, $2 the second, and so on
  348.  
  349.  anygem        if tomshell is run from the \auto\ folder or as a .TOS
  350.         program, set this variable to "off" before running any
  351.         programs within Tomshell.  This disables the mouse on/off
  352.         routines and automatic GEM program recognition (.prg/.app).
  353.  
  354.  cwd        current working directory. "set cwd gleep" is equivalent
  355.         to "cd gleep".  Good for putting in the prompt string.
  356.  
  357.  date        the current date: Mmm dd, yyyy
  358.  
  359.  disk        free space on the current drive, in kilobytes.
  360.  
  361.  dcd        DCD pin on serial port (carrier detect).
  362.  
  363.  dcdwatch    if this is set to "on", TomShell will exit to its calling
  364.         program as soon as it detects loss of carrier. Default is
  365.         off.
  366.  
  367.  f        list of all the function key settings
  368.  
  369.  f1..f20    individual function key macro settings.  f11..f20 mean
  370.          shift+f1 to shift+f10. Always use "definition" when
  371.         setting these (always use quotes).  To include a <return>,
  372.         use "\r".
  373.         Similarly:    \b    backspace
  374.                 \t    tab
  375.                 \e    escape
  376.                 \r    return
  377.                 \<    left arrow
  378.                 \>    right arrow
  379.                 \[    shift-left arrow
  380.                 \]    shift-right arrow
  381.                 \^    up arrow
  382.                 \v    down arrow
  383.  
  384.  flash (NEW)    the cursor flash rate (0 for a steady cursor).  If you're
  385.         like me and don't like flashing cursors, stick a
  386.         "set flash 0" in your tomshell.bat file.  If you are trying
  387.         to avoid Line-A calls (advisable on TOS 2 and up), don't
  388.         *read* this variable.  Setting it is okay, but reading it
  389.         does line-A stuff to figure out if the cursor is actually
  390.         flashing or not.  There must be a better way... :-)
  391.  
  392.  font        big/small (monochrome only).  Refers to the system font size,
  393.         small == 8x8, big == 8x16.  The 8x8 (small) font gives you
  394.         50 lines per screen, the 8x16 (big) font gives you 25.
  395.         Default is big.
  396.  
  397.  force        if this is set to "on", the [P] and [S] keys are disabled
  398.         (display is uninterruptable).  Default is off.
  399.  
  400.  key        "on" if there is a key waiting in the key input buffer
  401.  
  402.  keystat    bit mapped number, each bit represents a different status
  403.         key:
  404.         bit    value    meaning
  405.         0     1    right shift
  406.         1     2    left shift
  407.         2     4    control
  408.         3     8    alternate
  409.         4    16    caps lock on
  410.         5    32    right mouse button
  411.         6    64    left mouse button
  412.  
  413.  margin        the number of spaces output before each line displayed
  414.         (after each <cr><lf>).  Usually only good for printing.
  415.         Default is 0.
  416.  
  417.  mem        the size of the largest block of free memory, in kilobytes.
  418.  
  419.  nolabel    "exit" or "cont".  Controls behaviour of tomshell when
  420.         a label is not found (goto/gosub).  "exit" will force
  421.         a "system" command when a variable is not found, and when
  422.         $nolabel == "cont", tomshell will continue as if the gosub
  423.         or goto command had not been made.  Default is exit.
  424.  
  425.  owrite        controls behaviour when the destination file for a cp or
  426.          mv operation already exists. "off", "on", and "ask".
  427.         Should be obvious.
  428.  
  429.  PATH        list of folders, separated by commas, where tomshell will
  430.          search for programs and batch files that are called but
  431.         not found in the current directory. "." does not need to
  432.         been included.
  433.  
  434.  pause (NEW)    set to any value under 32767 to pause after the given number
  435.         of lines have been displayed (since the last keypress).
  436.         The "More..." prompt will be shown, and you can type:
  437.             S    stop output: like normal [s]
  438.             C    continuous: don't do any more pausing
  439.         Note that the C option is temporary; it will stay in effect
  440.         until you press a key.  This includes pressing a key during
  441.         the listing of (for instance) the file being displayed,
  442.         which is a bit silly but sometimes useful.
  443.         To turn this feature off permanently, set pause to 0.
  444.         The default for this variable is 0 (no pause).
  445.  
  446.  prompt (NEW)    like many shells' prompt string, but slightly more powerful
  447.         and interesting.  Not only can you display whatever you want
  448.         in place of the standard "1 c:\tomshell > " prompt, you can
  449.         run programs and execute other commands when the prompt is
  450.         displayed.  Please note that this is a bad place to put an
  451.         "interact" command.  Probably the worst place.  Don't. :)
  452.         A trailing space character is always output after this
  453.         command is executed, since it's very difficult to coerce
  454.         tomshell into outputting a space character on its own.
  455.         The default setting is "echo -n $ncmd $cwd >", which outputs
  456.         the index of the current command (useful for !13 etc) and
  457.         the current directory.  You could run batch files and neat
  458.         stuff like that from here, but it's good to keep the
  459.         execution time of this command down, since it's done a lot.
  460.         Usually you'll just use the "echo" command.
  461.         
  462.         When setting this, put the command you want to be in the
  463.         prompt string in quotation marks.  Otherwise, $variables
  464.         are likely to be evaluated at the time of the "set prompt"
  465.         command rather than during execution of the prompt string.
  466.         
  467.         set prompt "goo;echo -n $ncmd FOOBAR $cwd SILLY >"
  468.  
  469.  quick        "on" or "off".  Makes output to the screen quicker, but
  470.          must be turned off for remote use.  Default is off.
  471.  
  472.  resolution    the current resolution of the ST's screen. High, medium, or
  473.          low.
  474.  
  475.  shortdir    if on, the time and date are left off the "dir" listing.
  476.         Good for getting two columns on an 80-column screen and
  477.         still seeing the file sizes and attributes.  Default is
  478.         off.
  479.  
  480.  status        the exit code returned by the last command or program
  481.          executed.  Most tomshell commands leave $status intact.
  482.  
  483.  time        the current time.  hh:mm:ss in 24-hour format.
  484.  
  485.  verbosity    0, 1, and 2 supported now.  Controls amount of information
  486.         displayed by tomshell.  Currently only restricts "cmd exit
  487.         code #" (displayed only when $verbosity >= 1) and "File
  488.         not found" (GEMDOS verbal error messages) (displayed only
  489.         when $verbosity >= 2).  Default is 2.
  490.  
  491.  volume        if set to "on", the volume name and serial number of the
  492.         disk in question will be displayed on the first line of a
  493.         "dir" output.  Default is off.
  494.  
  495.  width        screen width.  Used for figuring out how many columns to
  496.         use in "ls" and "dir".
  497.  
  498.  ------------------
  499.  Special characters
  500.  ------------------
  501.  >     >>    <     $     \     #     ;     !     "
  502.  
  503.  >        |
  504.  >>        | redirection
  505.  <        |
  506.  
  507.  $        precedes variable names (echo $name)
  508.  
  509.  \        separates directory names from each other and from filenames
  510.  
  511.  #        (.tom files) from here to end of line is a comment
  512.  
  513.  ;        separates two or more commands (echo $name;cat phroo;exit)
  514.  
  515.  !        used to access command history entries (see "history")
  516.  
  517.  "        text enclosed in "quotes" will not be inspected for > <
  518.         >> $ -n etc.  Use if you want to print "test   test" (>1
  519.         space between words) or "$56.45" or "shmoo -n pak" or
  520.         something like that.
  521.  
  522.  =======================================================================
  523.  5. Explanations
  524.  ===============
  525.  
  526.  .1 Batch files
  527.  --------------
  528.  To create a batch file, use any editor or word processor that can save
  529.  a file "as ASCII", that is, with no special format or styling commands.
  530.  An editor such as STeno or MicroEmacs will do fine.  Each line of a batch
  531.  file is processed separately, just as if it were entered on the keyboard
  532.  in interactive mode.  There are a few important differences, however. The
  533.  first is that there are some commands available only in batch files.  See
  534.  "Batch files only" above for a list of these commands.  Comments can also
  535.  be imbedded in batch files.  To include a comment in a batch file, use a
  536.  # character.  When Tomshell sees a # it will disregard everything until
  537.  it gets to the next line of the file.
  538.    Batch files' filenames should end with .bat, .tom, or .btp (for
  539.  NeoDesk users).  To execute a batch file, simply type its name.  You don't
  540.  need to type the .bat (or whatever) at the end of it, but it won't do
  541.  any harm.  When Tomshell is looking for programs matching a certain name
  542.  (such as when you type "phroo"), priority will be given to batch files over
  543.  program files (.prg, .tos, .ttp, .app).  This means that if you tell
  544.  Tomshell to run "foo", and there is a "foo.bat" and a "foo.tos" in the
  545.  current directory, Tomshell will run "foo.bat".
  546.    When it is first run, Tomshell will look for a batch file called
  547.  "tomshell.tom" or "tomshell.bat" and automatically execute it before
  548.  entering interactive mode.  This is a good place to put some commonly used
  549.  aliases and variable assignments, and possibly turn off the keyclick or
  550.  something like that.  It's just like autoexec.bat in the Messydos world.
  551.  
  552.  .2 Errorlevels
  553.  --------------
  554.  An errorlevel (also called return code or status) is a number that
  555.  has some particular meaning, specific to the program or batch file that
  556.  returns it.  The negative errorlevels are usually reserved for errors
  557.  relating to the operating system, such as -33, which means "file not
  558.  found" and is well known to anyone using a command line interpreter for
  559.  more than about five seconds.  Tomshell will look for negative errorlevels
  560.  and output an appropriate message, if it has one.  Whether or not Tomshell
  561.  finds a verbal message, it will output a "cmd exit code #" if the
  562.  status after the last command is not zero.  Zero is returned when nothing
  563.  of note has happened and everything is fine and dandy, so there is no
  564.  need for any "warning" to this effect.
  565.    Aside from the reserved gemdos/bios/xbios errorlevels, a number returned
  566.  by a program can mean just about anything.  Some programs even return weird
  567.  numbers like 2851, for no apparent reason.  Usually, however, programs will
  568.  return a 0, unless an error occurs.  You can set up batch files and
  569.  programs that return meaningful error codes not necessarily relating to
  570.  errors.  For example, a BBS program may exit and return 8, which means that
  571.  it's midnight and the "today's callers" file should be deleted, and maybe
  572.  some other stuff.
  573.    The errorlevel returned by the last command is kept in the status variable
  574.  ($status).  If you don't want the verbal messages ("File not found"), set
  575.  $verbosity to 1.  If you don't want the verbal messages _or_ the numeric
  576.  messages, set $verbosity to 0.  The default for $verbosity is 2 (show
  577.  both lines).
  578.  
  579.  .3 Filename completion
  580.  ----------------------
  581.  A very useful feature of TomShell, and one for which I got the inspiration
  582.  and keys and so on from Gulam, is filename completion.  With this nifty
  583.  doo-dad, you can get a list of all the files that start with what you've
  584.  just typed.  This only works if the cursor is in the last position of
  585.  the entered command line (at the very end).
  586.  
  587.  If the command line looks like this:
  588.  d:\devpac > cp c:\bin\foobar\jam
  589.          The cursor must be here ^ for filename completion to do anything.
  590.  
  591.    If you press Tab, Insert, or ^I (ASCII tab), TomShell will attempt to
  592.  expand the partial filename you have typed as much as it can, which is
  593.  until either there is more than one match or the complete filename has
  594.  been completed.  For example, if you have the following files in the
  595.  current directory:
  596.  
  597.   foobar
  598.   fubar
  599.   fooobar
  600.   tomfile
  601.  
  602.  Pressing any of the abovementioned keys will accomplish the following:
  603.  
  604.   You type...            TomShell turns into...
  605.   f                             f
  606.   fu                fubar
  607.   fo                foo
  608.   foo                foo
  609.   fooo                fooobar
  610.   foob                foobar
  611.   t                tomfile
  612.  
  613.  If tomshell manages to fill in the complete filename, it will also add
  614.  a space after it, which not only lets you know that the filename is complete,
  615.  but readies the command line for another, separate, argument.
  616.  
  617.  If you use the Home key (or ^O), TomShell will first do everything mentioned
  618.  above, but if it can't fill in the whole filename it will give you a
  619.  list (in "ls" format) of all files that match the most specific pattern
  620.  that it can derive.  The command line will then reappear with the text
  621.  you entered before the ^O still intact.
  622.  
  623.  Try it, it's neat.  It's particularly handy for accessing files such as
  624.  temporary files created by Arc: "a6238124.tmp" can be entered, in most
  625.  cases, by typing "a6<tab>", which is considerably faster than typing
  626.  in the whole filename yourself.
  627.  
  628.  *** Starting with 0.911, filename completion can also be applied to variables,
  629.  in order to check their contents.  For example, to add to your PATH variable,
  630.  type "set PATH $PATH" <tab> ",c:\bar,f:\sneh".
  631.  
  632.  .4 Modes of Operation
  633.  ---------------------
  634.  Tomshell has two modes of operation.  At any given time, it is either
  635.  processing commands from a batch file or waiting for you to type commands
  636.  directly into the shell and processing them as they are entered.  The
  637.  second ("interactive") mode can be entered from the first ("batch") mode
  638.  with the "interact" function.  To return to batch mode from interactive
  639.  mode, give the "exit" command.  If you are in the "top" level (not within
  640.  a batch file or interact command, which incidentally can also be used from
  641.  the command line) and you issue the "exit" command, Tomshell will terminate
  642.  and you will be returned to the desktop, or whatever you ran tomshell from.
  643.  
  644.  Batch files can be started up from within other batch files with no problem.
  645.  Actually, there is a limit to how "deep" this can go, but it shouldn't get
  646.  in your way.
  647.  
  648.  .5 Output devices
  649.  -----------------
  650.  There are a few special output devices that can be used with the
  651.  redirection operators (> >> <) for various purposes.  The devices supported
  652.  by Tomshell are:
  653.  
  654.  con:            the console (screen)
  655.  prn:            the parallel port (printer)
  656.  aux:            the serial port (modem)
  657.  
  658.  Use these devices in place of filenames and output from commands (and
  659.  properly written programs) will be output to them rather than the current
  660.  output/input device (usually con:).
  661.  
  662.  .6 Running Programs
  663.  -------------------
  664.  If you type only the main filename of the program you want to run, the
  665.  rest will be added automatically if a matching file is found.  If more
  666.  than one executable (.bat, .btp, .tom, .prg, .tos, .ttp, .app) matches
  667.  the given filename, priority is given to the first batch file in the
  668.  directory listing as it is on the disk.  This is not always the first
  669.  one displayed in a "dir" listing, but usually this shouldn't be a
  670.  consideration.
  671.  
  672.  If the extension of the file is not given, and there is no executable
  673.  match found in the current directory, the directories listed in the "PATH"
  674.  variable (separated by commas) are searched in the order in which they
  675.  appear in the list.  If the extension of the file _is_ given, and the
  676.  file is not found in the current directory, the PATH directories will
  677.  not be searched.
  678.  
  679.  .7 Variables
  680.  ------------
  681.  These are very important things for everything but the most basic of
  682.  applications.  They are exactly what they sound like.  You can keep anything
  683.  you want in a variable: numbers, text, symbols, whatever.  If you want to
  684.  include reserved characters (such as > or ;) that would otherwise mess up
  685.  Tomshell's operation, simply include them in "quotation marks".  At the
  686.  moment, Tomshell has no math operators (even + and -) so you can't do much
  687.  in the way of counting or things like that.  You can compare variables,
  688.  input them from the user, display them, and so on.  The most notable
  689.  variables are the reserved variables used by various parts of Tomshell
  690.  (see _Special_variables_).
  691.    To change the value of a variable, use the "set" command. For example,
  692.  
  693.  set foo bar
  694.  
  695.    will create the variable "foo" (or change it if it already exists) and
  696.  set its value to "bar".  The reserved variables work the same way:
  697.  
  698.  set verbosity 1
  699.  
  700.    Some reserved variables are read-only (for obvious reasons), such as
  701.  $disk (free space on the current drive) and $mem (largest block of free
  702.  memory).
  703.  
  704.    You've probably noticed the $ in front of the variable names by now, and
  705.  may not know why it's there.  All it does is tell Tomshell that the word
  706.  immediately following it is the name of a variable and should be replaced
  707.  with the value of that variable.  For example, to echo (show) the free space
  708.  on the current drive, type
  709.  
  710.  echo $disk
  711.  
  712.    This tells Tomshell to look for a variable called "disk" and echo that
  713.  rather than the word "disk".
  714.  
  715.    The $ is not required for the "set" command.  In fact, you can become
  716.  quite confused if you start typing something like
  717.  
  718.  set $verbosity 2
  719.  
  720.    This might, for example, create a variable called "1" and set its value
  721.  to "2".  This presumably isn't what you want.  If you want to copy the
  722.  contents of variable a to variable b, type
  723.  
  724.  set b $a
  725.  
  726.    Note that the $ is used for the "a" variable.  This is because we want
  727.  to set the variable "b" to _the_contents_of_ $a.  Typing the $a tells
  728.  Tomshell to use the contents of the "a" variable.
  729.  
  730.  Enjoy.
  731.  
  732.  Tom Clegg
  733.  
  734.  
  735.  Contact me by mail at 276 Main Street, Ottawa K1S 1C9, or on NCAUG BBS
  736.  at 613-231-3633 and -3636.
  737.