home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / utility / misc / tomshell / tsh_ref.txt < prev   
Text File  |  1992-09-15  |  26KB  |  688 lines

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