home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / sysutils / msshell / sh.man < prev    next >
Text File  |  1992-06-20  |  135KB  |  2,234 lines

  1.  
  2.  
  3.  
  4.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  5.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  6.  
  7.  
  8.  
  9.  NNNNAAAAMMMMEEEE
  10.       sh, rsh - shell, the standard/restricted command programming language
  11.  
  12.  SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.       sssshhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnmmmmrrrrssssttttuuuuvvvvxxxx0000RRRR ] [ args ]
  14.       rrrrsssshhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnmmmmrrrrssssttttuuuuvvvvxxxx0000RRRR ] [ args ]
  15.  
  16.  DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.       _S_h is a command programming language that executes commands read  from
  18.       a  terminal  or  a  file.  _R_s_h is a restricted version of the standard
  19.       command interpreter _s_h; it is used to set up login names and execution
  20.       environments  whose capabilities are more controlled than those of the
  21.       standard shell.  See _I_n_v_o_c_a_t_i_o_n below for the meaning of arguments  to
  22.       the shell.
  23.  
  24.     DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss
  25.       A _b_l_a_n_k is a tab or a space.  A _n_a_m_e is a sequence of letters, digits,
  26.       or  underscores beginning with a letter or underscore.  A _p_a_r_a_m_e_t_e_r is
  27.       a name, a digit, or any of the characters ****, @@@@, ####, ????, ----, $$$$, and !!!!.
  28.  
  29.     CCCCoooommmmmmmmaaaannnnddddssss
  30.       A _s_i_m_p_l_e-_c_o_m_m_a_n_d is a sequence of non-blank _w_o_r_d_s separated by _b_l_a_n_k_s.
  31.       The  first  word  specifies  the  name  of the command to be executed.
  32.       Except as specified below, the remaining words are passed as arguments
  33.       to the invoked command.  The command name is passed as argument 0 (see
  34.       _e_x_e_c(2)).  The _v_a_l_u_e of a simple-command is  its  exit  status  if  it
  35.       terminates normally, or (octal) 200+_s_t_a_t_u_s if it terminates abnormally
  36.       (see _s_i_g_n_a_l(2) for a list of status values).
  37.  
  38.       A _p_i_p_e_l_i_n_e is a sequence of one or more _c_o_m_m_a_n_d_s separated by  ||||  (or,
  39.       for  historical  compatibility,  by  ^^^^).   The standard output of each
  40.       command but the last is connected by a _p_i_p_e(2) to the  standard  input
  41.       of  the  next command.  Each command is run as a separate process; the
  42.       shell waits for the last command to terminate.  The exit status  of  a
  43.       pipeline is the exit status of the last command.
  44.  
  45.       A _l_i_s_t is a sequence of one or more pipelines separated by ;;;;, &&&&  (OS/2
  46.       only), &&&&&&&&, or ||||||||, and optionally terminated by ;;;; or &&&& (OS/2 only).  Of
  47.       these four symbols, ;;;; and &&&& have  equal  precedence,  which  is  lower
  48.       precedence  than  that  of &&&&&&&& and ||||||||.  The symbols &&&&&&&& and |||||||| also have
  49.       equal precedence.  A semicolon (;;;;) causes sequential execution of  the
  50.       preceding  pipeline; an ampersand (&&&&) causes asynchronous execution of
  51.       the preceding pipeline (i.e., the shell does not wait for that command
  52.       to finish.  This option is only available under OS/2 and is restricted
  53.       to single commands and not pipelines because of the differences in the
  54.       UNIX  and  OS/2  process  models).  The symbol &&&&&&&& (||||||||) causes the _l_i_s_t
  55.       following it to be executed only if the preceding pipeline  returns  a
  56.       zero  (non-zero)  exit  status.   An arbitrary number of new-lines may
  57.       appear in a _l_i_s_t, instead of semicolons, to delimit commands.
  58.  
  59.  
  60.  
  61.  
  62.                                     - 1 -         Formatted:  April 14, 1992
  63.  
  64.  
  65.  
  66.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  67.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  68.  
  69.  
  70.  
  71.       A _c_o_m_m_a_n_d is either a simple-command or one of the following.   Unless
  72.       otherwise  stated, the value returned by a command is that of the last
  73.       simple-command executed in the command.
  74.  
  75.       ffffoooorrrr _n_a_m_e [ iiiinnnn _w_o_r_d ... ] ddddoooo _l_i_s_t ddddoooonnnneeee
  76.            Each time a ffffoooorrrr command is executed, _n_a_m_e is set to the next _w_o_r_d
  77.            taken  from  the  iiiinnnn _w_o_r_d list.  If iiiinnnn _w_o_r_d ...  is omitted, then
  78.            the ffffoooorrrr command executes the ddddoooo _l_i_s_t  once  for  each  positional
  79.            parameter   that  is  set  (see  _P_a_r_a_m_e_t_e_r  _S_u_b_s_t_i_t_u_t_i_o_n  below).
  80.            Execution ends when there are no more words in the list.
  81.  
  82.       sssseeeelllleeeecccctttt _n_a_m_e [ iiiinnnn _w_o_r_d ... ] ddddoooo _l_i_s_t ddddoooonnnneeee
  83.            A sssseeeelllleeeecccctttt command prints on standard error  (file  descriptor  2),
  84.            the  set  of _w_o_r_ds, each preceded by a number.  If iiiinnnn _w_o_r_d ... is
  85.            omitted, then the positional parameters  are  used  instead  (see
  86.            _P_a_r_a_m_e_t_e_r  _S_u_b_s_t_i_t_u_t_i_o_n  below).  The PPPPSSSS3333 prompt is printed and a
  87.            line is read from the standard input.  If this line  consists  of
  88.            the  number  of  one  of  the listed _w_o_r_ds, then the value of the
  89.            parameter _n_a_m_e is set to the _w_o_r_d corresponding to  this  number.
  90.            If  this  line  is  empty  the  selection  list is printed again.
  91.            Otherwise the value of the parameter _n_a_m_e is set  to  null.   The
  92.            contents  of  the  line  read from standard input is saved in the
  93.            parameter RRRREEEEPPPPLLLLYYYY.  The list is executed for each selection until a
  94.            break or end-of-file is encountered.
  95.  
  96.       ccccaaaasssseeee _w_o_r_d iiiinnnn [ _p_a_t_t_e_r_n [ | _p_a_t_t_e_r_n ] ... )))) _l_i_s_t ;;;;;;;; ] ... eeeessssaaaacccc
  97.            A ccccaaaasssseeee command  executes  the  _l_i_s_t  associated  with  the  first
  98.            _p_a_t_t_e_r_n  that matches _w_o_r_d.  The form of the patterns is the same
  99.            as that used for file-name generation (see _F_i_l_e _N_a_m_e  _G_e_n_e_r_a_t_i_o_n)
  100.            except  that  a  slash,  a  leading  dot,  or  a  dot immediately
  101.            following a slash need not be matched explicitly, and  the  match
  102.            is case sensitive.
  103.  
  104.       iiiiffff _l_i_s_t tttthhhheeeennnn _l_i_s_t [ eeeelllliiiiffff _l_i_s_t tttthhhheeeennnn _l_i_s_t ] ... [ eeeellllsssseeee _l_i_s_t ] ffffiiii
  105.            The _l_i_s_t following iiiiffff is executed and, if it returns a zero  exit
  106.            status,   the   _l_i_s_t   following  the  first  tttthhhheeeennnn  is  executed.
  107.            Otherwise, the _l_i_s_t following eeeelllliiiiffff is executed and, if its  value
  108.            is  zero,  the _l_i_s_t following the next tttthhhheeeennnn is executed.  Failing
  109.            that, the eeeellllsssseeee _l_i_s_t is executed.  If no eeeellllsssseeee _l_i_s_t or tttthhhheeeennnn _l_i_s_t is
  110.            executed, then the iiiiffff command returns a zero exit status.
  111.  
  112.       wwwwhhhhiiiilllleeee _l_i_s_t ddddoooo _l_i_s_t ddddoooonnnneeee
  113.            A wwwwhhhhiiiilllleeee command repeatedly executes the wwwwhhhhiiiilllleeee _l_i_s_t  and,  if  the
  114.            exit status of the last command in the list is zero, executes the
  115.            ddddoooo _l_i_s_t; otherwise the loop terminates.  If no commands in the ddddoooo
  116.            _l_i_s_t  are  executed,  then  the wwwwhhhhiiiilllleeee command returns a zero exit
  117.            status; uuuunnnnttttiiiillll may be used in place of wwwwhhhhiiiilllleeee to  negate  the  loop
  118.            termination test.
  119.  
  120.       ((((_l_i_s_t))))
  121.            Execute _l_i_s_t in a sub-shell.  The shell creates a new environment
  122.  
  123.  
  124.                                     - 2 -         Formatted:  April 14, 1992
  125.  
  126.  
  127.  
  128.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  129.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  130.  
  131.  
  132.  
  133.            in  which to execute the _l_i_s_t, but does not fork a sub-shell as a
  134.            Unix system would.   The  original  environment  is  restored  on
  135.            completion.
  136.  
  137.       {{{{ _l_i_s_t;;;; }}}}
  138.            _l_i_s_t is simply executed.
  139.  
  140.       [[[[[[[[ _e_x_p_r_e_s_s_i_o_n ]]]]]]]]
  141.            Evaluates  expression  and  returns  a  zero  exit  status   when
  142.            expression  is  true.   See  CCCCoooonnnnddddiiiittttiiiioooonnnnaaaallll EEEExxxxpppprrrreeeessssssssiiiioooonnnnssss below, for a
  143.            description of expression.  Note that [[[[[[[[ and ]]]]]]]] are keywords  and
  144.            require blanks between them and expression.
  145.  
  146.       ffffuuuunnnnccccttttiiiioooonnnn _n_a_m_e (((()))) {{{{ _l_i_s_t;;;; }}}}
  147.  
  148.       _n_a_m_e (((()))) {{{{ _l_i_s_t;;;; }}}}
  149.            Define a function which is referenced by _n_a_m_e.  The body  of  the
  150.            function  is  the _l_i_s_t of commands between {{{{ and }}}}.  Execution of
  151.            functions is described below (see _E_x_e_c_u_t_i_o_n).
  152.  
  153.       The following words are only recognized as the first word of a command
  154.       and when not quoted:
  155.  
  156.       iiiiffff tttthhhheeeennnn eeeellllsssseeee eeeelllliiiiffff ffffiiii ccccaaaasssseeee eeeessssaaaacccc ffffoooorrrr wwwwhhhhiiiilllleeee uuuunnnnttttiiiillll ddddoooo ddddoooonnnneeee {{{{ }}}} [[[[[[[[ ]]]]]]]]
  157.  
  158.     CCCCoooommmmmmmmeeeennnnttttssss
  159.       A word beginning with  ####  causes  that  word  and  all  the  following
  160.       characters up to a new-line to be ignored.
  161.  
  162.     AAAAlllliiiiaaaassssiiiinnnngggg
  163.       The first word of each command is replaced by the text of an alias  if
  164.       an  alias for this word has been defined.  The alias name must a valid
  165.       identifier.  The replacement string can contain any valid Shell script
  166.       including  the  metacharacters  listed  above.  The first word of each
  167.       command of the  replaced  text  will  not  be  tested  for  additional
  168.       aliases.  If the last character of the alias value is a blank then the
  169.       word following the alias will also be checked for alias  substitution.
  170.       Aliases can be used to redefine special builtin commands but cannot be
  171.       used to redefine the keywords listed above.  Aliases  can  be  created
  172.       and  listed with the aaaalllliiiiaaaassss command and can be removed with the uuuunnnnaaaalllliiiiaaaassss
  173.       command.
  174.  
  175.       Aliasing is performed when  scripts  are  read,  not  while  they  are
  176.       executed.   Therefore,  for  an alias to take effect the alias command
  177.       has to be executed before the command which references  the  alias  is
  178.       read.
  179.  
  180.       Aliases are frequently used as a short hand for full path  names.   An
  181.       option  to  the  aliasing facility allows the value of the alias to be
  182.       automatically set to the full pathname of the  corresponding  command.
  183.       These  aliases  are  called  tracked  aliases.  The value of a tracked
  184.  
  185.  
  186.                                     - 3 -         Formatted:  April 14, 1992
  187.  
  188.  
  189.  
  190.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  191.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  192.  
  193.  
  194.  
  195.       alias is defined the first time the corresponding command is looked up
  196.       and  becomes  undefined  each  time the PATH variable is reset.  These
  197.       aliases remain tracked so that  the  next  subsequent  reference  will
  198.       redefine the value.
  199.  
  200.     CCCCoooonnnnddddiiiittttiiiioooonnnnaaaallll EEEExxxxpppprrrreeeessssssssiiiioooonnnnssss
  201.       A conditional expression is used with the [[[[[[[[ compound command to  test
  202.       attributes  of  files and to compare strings.  Word splitting and file
  203.       name generation are not performed on the  words  between  [[[[[[[[  and  ]]]]]]]].
  204.       Each  expression  can be constructed from one or more of the following
  205.       unary or binary expressions:
  206.  
  207.            ----aaaa _f_i_l_e     True if _f_i_l_e exists.
  208.  
  209.            ----bbbb _f_i_l_e     True if _f_i_l_e exists and is a block special file.
  210.  
  211.            ----cccc _f_i_l_e     True if _f_i_l_e exists and is a character special file.
  212.  
  213.            ----dddd _f_i_l_e     True if _f_i_l_e exists and is a directory.
  214.  
  215.            ----ffff _f_i_l_e     True if _f_i_l_e exists and is a regular file.
  216.  
  217.            ----gggg _f_i_l_e     True if _f_i_l_e exists and has its setgid bit set.
  218.  
  219.            ----hhhh _f_i_l_e     True if _f_i_l_e exists and is a symbolic link.
  220.  
  221.            ----kkkk _f_i_l_e     True if _f_i_l_e exists and has its sticky bit set.
  222.  
  223.            ----nnnn _s_t_r_i_n_g   True if the length of _s_t_r_i_n_g is non-zero.
  224.  
  225.            ----oooo _o_p_t_i_o_n   True if the _o_p_t_i_o_n named is on.
  226.  
  227.            ----pppp _f_i_l_e     True if _f_i_l_e exists and is a fifo special file  or  a
  228.                        pipe.
  229.  
  230.            ----rrrr _f_i_l_e     True if _f_i_l_e exists and is readable.
  231.  
  232.            ----ssss _f_i_l_e     True if _f_i_l_e exists and has a size greater than zero.
  233.  
  234.            ----tttt [ _f_i_l_d_e_s ]
  235.                        True if the open file whose file descriptor number is
  236.                        _f_i_l_d_e_s  (1  by default) is associated with a terminal
  237.                        device.
  238.  
  239.            ----uuuu _f_i_l_e     True if _f_i_l_e exists and has its setuid bit set.
  240.  
  241.            ----wwww _f_i_l_e     True if _f_i_l_e exists and is writable.
  242.  
  243.            ----xxxx _f_i_l_e     True if _f_i_l_e  exists  and  is  executable.   If  _f_i_l_e
  244.                        exists  and  is a directory, then the current process
  245.                        has permission to search in the directory.
  246.  
  247.  
  248.                                     - 4 -         Formatted:  April 14, 1992
  249.  
  250.  
  251.  
  252.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  253.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  254.  
  255.  
  256.  
  257.            ----zzzz _s_t_r_i_n_g   True if the length of _s_t_r_i_n_g is zero.
  258.  
  259.            ----LLLL _f_i_l_e     True if _f_i_l_e exists and is a symbolic link.
  260.  
  261.            ----OOOO _f_i_l_e     True if _f_i_l_e exists and is  owned  by  the  effective
  262.                        user id of this process.
  263.  
  264.            ----GGGG _f_i_l_e     True if _f_i_l_e exists and is  owned  by  the  effective
  265.                        user group of this process.
  266.  
  267.            ----SSSS _f_i_l_e     True if _f_i_l_e exists and is a socket.
  268.  
  269.            _f_i_l_e_1 ----nnnntttt _f_i_l_e_2
  270.                        True if file1 is newer than  file2.   True  if  _f_i_l_e_1
  271.                        exists and is newer than _f_i_l_e_2.
  272.  
  273.            _f_i_l_e_1 ----ooootttt _f_i_l_e_2
  274.                        True if _f_i_l_e_1 exists and is older than _f_i_l_e_2.
  275.  
  276.            _f_i_l_e_1 ----eeeeffff _f_i_l_e_2
  277.                        True if _f_i_l_e_1 and _f_i_l_e_2 and refer to the same file.
  278.  
  279.            _s_1 ==== _s_2     True if strings _s_1 and _s_2 are identical.
  280.  
  281.            _s_1 !!!!==== _s_2    True if strings _s_1 and _s_2 are _n_o_t identical.
  282.  
  283.            _s_1 <<<< _s_2     True if string _s_1 comes before _s_2 are  based  on  the
  284.                        ASCII value of their characters.
  285.  
  286.            _s_1 >>>> _s_2     True if string _s_1 comes after _s_2  are  based  on  the
  287.                        ASCII value of their characters.
  288.  
  289.            _n_1 ----eeeeqqqq _n_2   True if _n_1 is equal to _n_2.
  290.  
  291.            _n_1 ----nnnneeee _n_2   True if _n_1 is not equal to _n_2.
  292.  
  293.            _n_1 ----lllltttt _n_2   True if _n_1 is less than to _n_2.
  294.  
  295.            _n_1 ----ggggtttt _n_2   True if _n_1 is greater than to _n_2.
  296.  
  297.            _n_1 ----lllleeee _n_2   True if _n_1 is less than or equal to _n_2.
  298.  
  299.            _n_1 ----ggggeeee _n_2   True if _n_1 is greater than or equal to _n_2.
  300.  
  301.       Not all of the above have meaning under MSDOS or OS/2.  In such cases,
  302.       the appropriate value is set (_f_a_l_s_e, except for ----OOOO and ----GGGG).
  303.  
  304.       A compound expression can be  constructed  from  these  primitives  by
  305.       using any of the following, listed in decreasing order of precedence.
  306.  
  307.  
  308.  
  309.  
  310.                                     - 5 -         Formatted:  April 14, 1992
  311.  
  312.  
  313.  
  314.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  315.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  316.  
  317.  
  318.  
  319.                   (((( _e_x_p_r ))))
  320.                        True, if _e_x_p_r is true.  Used to group expressions.
  321.  
  322.                   !!!! _e_x_p_r
  323.                        True, if _e_x_p_r is false.
  324.  
  325.                   _e_x_p_r_1 &&&&&&&& _e_x_p_r_2
  326.                        True, if _e_x_p_r_1 and _e_x_p_r_2 are both true.
  327.  
  328.                   _e_x_p_r_1 |||||||| _e_x_p_r_2
  329.                        True, if _e_x_p_r_1 or _e_x_p_r_2 is true.
  330.  
  331.     TTTTiiiillllddddeeee SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  332.       Each word is checked to see if it begins with an unquoted~~~~.  If it is,
  333.       the  ~~~~ is replaced by the value of the HHHHOOOOMMMMEEEE parameter. A ~~~~ followed by
  334.       a ++++ or ---- is replaced by the value of  the  parameter  PPPPWWWWDDDD  and  OOOOLLLLDDDDPPPPWWWWDDDD
  335.       respectively.
  336.  
  337.     CCCCoooommmmmmmmaaaannnndddd SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  338.       The standard output from a command enclosed in parenthesis preceded by
  339.       a dollar sign ($$$$(((())))), or in a pair of grave accents (````````) may be used as
  340.       part or all of a word; trailing new-lines are  removed.   The  command
  341.       substitution  $$$$((((ccccaaaatttt _f_i_l_e)))) can be replaced by the equivalent but faster
  342.       $$$$((((<<<<_f_i_l_e)))).
  343.  
  344.     PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  345.       The character $$$$ is used to introduce substitutable _p_a_r_a_m_e_t_e_r_s.   There
  346.       are  two types of parameters, positional and keyword.  If _p_a_r_a_m_e_t_e_r is
  347.       a digit, it is a positional parameter.  Positional parameters  may  be
  348.       assigned  values by sssseeeetttt.  Keyword parameters (also known as variables)
  349.       may be assigned values by writing:
  350.  
  351.            _n_a_m_e = _v_a_l_u_e [ _n_a_m_e = _v_a_l_u_e ] ...
  352.  
  353.       Pattern-matching is  not  performed  on  _v_a_l_u_e.   There  cannot  be  a
  354.       function and a variable with the same _n_a_m_e.
  355.  
  356.       Alternatively, named parameters can be assigned values and  attributes
  357.       by using the typeset special command.
  358.  
  359.       $$$${{{{_p_a_r_a_m_e_t_e_r}}}}
  360.            The value, if any, of the _p_a_r_a_m_e_t_e_r is substituted.   The  braces
  361.            are  required only when _p_a_r_a_m_e_t_e_r is followed by a letter, digit,
  362.            or underscore that is not to be interpreted as part of its  name.
  363.            If  _p_a_r_a_m_e_t_e_r  is **** or @@@@, all the positional parameters, starting
  364.            with $$$$1111, are substituted (separated by spaces).  Parameter $$$$0000  is
  365.            set from argument zero when the shell is invoked.
  366.  
  367.       $$$${{{{####_p_a_r_a_m_e_t_e_r}}}}
  368.            If _p_a_r_a_m_e_t_e_r is **** or @@@@, the number of  positional  parameters  is
  369.            substituted.  Otherwise, the length of the value of the _p_a_r_a_m_e_t_e_r
  370.  
  371.  
  372.                                     - 6 -         Formatted:  April 14, 1992
  373.  
  374.  
  375.  
  376.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  377.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  378.  
  379.  
  380.  
  381.            is substituted.
  382.  
  383.       $$$${{{{_p_a_r_a_m_e_t_e_r::::----_w_o_r_d}}}}
  384.            If _p_a_r_a_m_e_t_e_r is  set  and  is  non-null,  substitute  its  value;
  385.            otherwise substitute _w_o_r_d.
  386.  
  387.       $$$${{{{_p_a_r_a_m_e_t_e_r::::====_w_o_r_d}}}}
  388.            If _p_a_r_a_m_e_t_e_r is not set or is null set it to _w_o_r_d; the  value  of
  389.            the  parameter  is substituted.  Positional parameters may not be
  390.            assigned to in this way.
  391.  
  392.       $$$${{{{_p_a_r_a_m_e_t_e_r::::????_w_o_r_d}}}}
  393.            If _p_a_r_a_m_e_t_e_r is  set  and  is  non-null,  substitute  its  value;
  394.            otherwise,  print  _w_o_r_d  and  exit  from  the  shell.  If _w_o_r_d is
  395.            omitted, the message ``parameter null or not set'' is printed.
  396.  
  397.       $$$${{{{_p_a_r_a_m_e_t_e_r::::++++_w_o_r_d}}}}
  398.            If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute  _w_o_r_d;  otherwise
  399.            substitute nothing.
  400.  
  401.       $$$${{{{_p_a_r_a_m_e_t_e_r####_p_a_t_t_e_r_n}}}}
  402.            $$$${{{{_p_a_r_a_m_e_t_e_r########_p_a_t_t_e_r_n}}}} If the Shell _p_a_t_t_e_r_n matches the  beginning
  403.            of the value of _p_a_r_a_m_e_t_e_r, then the value of this substitution is
  404.            the value of the _p_a_r_a_m_e_t_e_r  with  the  matched  portion  deleted;
  405.            otherwise  the  value  of  this _p_a_r_a_m_e_t_e_r is substituted.  In the
  406.            first form the smallest matching _p_a_t_t_e_r_n is deleted  and  in  the
  407.            latter form the largest matching _p_a_t_t_e_r_n is deleted.
  408.  
  409.       $$$${{{{_p_a_r_a_m_e_t_e_r%%%%_p_a_t_t_e_r_n}}}}
  410.            $$$${{{{_p_a_r_a_m_e_t_e_r%%%%%%%%_p_a_t_t_e_r_n}}}} If the Shell _p_a_t_t_e_r_n matches the end of the
  411.            value  of  _p_a_r_a_m_e_t_e_r,  then the value of this substitution is the
  412.            value  of  the  _p_a_r_a_m_e_t_e_r  with  the  matched  portion   deleted;
  413.            otherwise  the  value  of  this _p_a_r_a_m_e_t_e_r is substituted.  In the
  414.            first form the smallest matching _p_a_t_t_e_r_n is deleted  and  in  the
  415.            latter form the largest matching _p_a_t_t_e_r_n is deleted.
  416.  
  417.       In the above, _w_o_r_d is not evaluated unless it is to  be  used  as  the
  418.       substituted string, so that, in the following example, ppppwwwwdddd is executed
  419.       only if dddd is not set or is null:
  420.  
  421.            echo ${d:-`pwd`}
  422.  
  423.       If the colon (::::) is omitted from the above expressions, the shell only
  424.       checks  whether  _p_a_r_a_m_e_t_e_r  is  set  or not (_I_t _i_s _n_o_t _c_l_e_a_r _w_h_a_t _t_h_i_s
  425.       _m_e_a_n_s).
  426.  
  427.       The following parameters are automatically set by the shell:
  428.  
  429.            ####    The number of positional parameters in decimal.
  430.  
  431.  
  432.  
  433.  
  434.                                     - 7 -         Formatted:  April 14, 1992
  435.  
  436.  
  437.  
  438.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  439.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  440.  
  441.  
  442.  
  443.            ----    Flags supplied to the shell on  invocation  or  by  the  sssseeeetttt
  444.                 command.
  445.  
  446.            ????     The  decimal  value  returned  by  the  last  synchronously
  447.                 executed command.
  448.  
  449.            $$$$    The process number of this shell.
  450.  
  451.            !!!!    The process number of the last background command invoked.
  452.  
  453.            ____    The last argument of the previous command.
  454.  
  455.            ~~~~    The shell reserves all variables beginning with a ~~~~ for  its
  456.                 own  internal  use and these variables cannot be accessed by
  457.                 the user.
  458.  
  459.       The following parameters are used by the shell:
  460.  
  461.            CCCCDDDDPPPPAAAATTTTHHHH
  462.                 The search path for the _c_d command.  (Note  that  because  a
  463.                 colon  is used by MSDOS to indicate a drive, a semi-colon is
  464.                 used to separate the path names instead of a  colon  -  this
  465.                 implies that the CDPATH variable must be set using single or
  466.                 double quotes to surround the value).
  467.  
  468.            CCCCOOOOLLLLUUUUMMMMNNNNSSSS
  469.                 This variable is contains  the  number  of  columns  on  the
  470.                 screen.   Currently,  the  shell  only  sets the variable in
  471.                 interactive mode, if it is not already set.
  472.  
  473.            CCCCOOOOMMMMSSSSPPPPEEEECCCC
  474.                 When the shell has to process an MSDOS  ._b_a_t  or  OS/2  ._c_m_d
  475.                 file,  it  expects  the  file indicated by the value of this
  476.                 environment variable to be an executable program capable  of
  477.                 processing the MSDOS ._b_a_t or OS/2 ._c_m_d file.  The program is
  478.                 invoked with the arguments ////cccc ffffiiiilllleeee____nnnnaaaammmmeeee.
  479.  
  480.            EEEENNNNVVVV  If this parameter is set,  then  parameter  substitution  is
  481.                 performed  on  the  value  to  generate  the pathname of the
  482.                 script that will be executed when the shell is invoked  (See
  483.                 Invocation  below).   This  file is typically used for alias
  484.                 and function definitions.
  485.  
  486.            EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD____LLLLIIIINNNNEEEE
  487.                 This parameter pointers to a file which contains information
  488.                 for  the  shell  about how command lines are to be built for
  489.                 particular external programs and how  to  convert  from  the
  490.                 format entered to the shell (see _C_o_m_m_a_n_d _L_i_n_e _B_u_i_l_d_i_n_g).
  491.  
  492.            FFFFCCCCEEEEDDDDIIIITTTT
  493.                 The default editor name for the fc command.
  494.  
  495.  
  496.                                     - 8 -         Formatted:  April 14, 1992
  497.  
  498.  
  499.  
  500.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  501.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  502.  
  503.  
  504.  
  505.            HHHHIIIISSSSTTTTFFFFIIIILLLLEEEE
  506.                 The  file  where  command  history  is  saved  across  login
  507.                 sessions.  The default value is $$$$HHHHOOOOMMMMEEEE////hhhhiiiissssttttoooorrrryyyy....sssshhhh.
  508.  
  509.            HHHHOOOOMMMMEEEE The default argument (home directory) for the _c_d command.
  510.  
  511.            IIIIFFFFSSSS  Internal field separators, normally  ssssppppaaaacccceeee,  ttttaaaabbbb,  and  nnnneeeewwww----
  512.                 lllliiiinnnneeee.
  513.  
  514.            LLLLIIIINNNNEEEESSSS
  515.                 This variable is contains the number of lines on the screen.
  516.                 Currently,  the  shell only sets the variable in interactive
  517.                 mode, if it is not already set.
  518.  
  519.            MMMMAAAAIIIILLLL If this parameter is set to the name of a mail file _a_n_d  the
  520.                 MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH parameter is not set, the shell informs the user of
  521.                 the arrival of mail in the specified file.
  522.  
  523.            MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK
  524.                 This parameter specifies how often (in  seconds)  the  shell
  525.                 will check for the arrival of mail in the files specified by
  526.                 the MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH or MMMMAAAAIIIILLLL parameters.  If set  to  0,  the  shell
  527.                 will check before each prompt.
  528.  
  529.            MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH
  530.                 A semi-colon (;;;;) separated list  of  file  names.   If  this
  531.                 parameter  is set, the shell informs the user of the arrival
  532.                 of mail in any of the specified files. Each file name can be
  533.                 followed  by  %%%%  and a message that will be printed when the
  534.                 modification time changes.  The default message is "_y_o_u _h_a_v_e
  535.                 _m_a_i_l".
  536.  
  537.            OOOOLLLLDDDDPPPPWWWWDDDD
  538.                 The previous working directory set by the ccccdddd command.
  539.  
  540.            PPPPAAAATTTTHHHH The search path for commands  (see  _E_x_e_c_u_t_i_o_n  below).   The
  541.                 user may not change PPPPAAAATTTTHHHH if executing under _r_s_h.  (Note that
  542.                 because a colon is used by MSDOS  to  indicate  a  drive,  a
  543.                 semi-colon  is  used to separate the path names instead of a
  544.                 colon - this implies that the  PATH  variable  must  be  set
  545.                 using  single  or double quotes to surround the value).  The
  546.                 Shell automatically converts Unix format PPPPAAAATTTTHHHH assignments to
  547.                 MSDOS format when appropriate.  A assignment is converted if
  548.                 there are no semi-colons, no \\\\s and one or more colons.   If
  549.                 there is only one colon, it must not be the second character
  550.                 of the new value.
  551.  
  552.            PPPPWWWWDDDD  The present working directory set by the ccccdddd command.
  553.  
  554.            PPPPSSSS1111  Primary prompt string, by default ``$$$$ ''.
  555.  
  556.  
  557.  
  558.                                     - 9 -         Formatted:  April 14, 1992
  559.  
  560.  
  561.  
  562.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  563.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  564.  
  565.  
  566.  
  567.            PPPPSSSS2222  Secondary prompt string, by default ``>>>> ''.
  568.  
  569.            PPPPSSSS3333  Selection prompt string used within a select loop, ``####???? ''.
  570.  
  571.            PPPPSSSS4444  The value  of  this  parameter  is  expanded  for  parameter
  572.                 substitution  and  precedes each line of an execution trace.
  573.                 If omitted, the execution trace prompt is ``+ ''.
  574.  
  575.            RRRRAAAANNNNDDDDOOOOMMMM
  576.                 Each time this parameter is referenced, a random integer  is
  577.                 generated.    The   sequence   of   random  numbers  can  be
  578.                 initialized by assigning a numeric value to RRRRAAAANNNNDDDDOOOOMMMM.
  579.  
  580.            RRRREEEEPPPPLLLLYYYY
  581.                 This parameter is set by the sssseeeelllleeeecccctttt  ssssttttaaaatttteeeemmmmeeeennnntttt  aaaannnndddd  bbbbyyyy  tttthhhheeee
  582.                 rrrreeeeaaaadddd special command when no arguments are supplied.
  583.  
  584.            SSSSEEEECCCCOOOONNNNDDDDSSSS
  585.                 Each time  this  parameter  is  referenced,  the  number  of
  586.                 seconds   since  shell  invocation  is  returned.   If  this
  587.                 parameter is assigned a value, then the value returned  upon
  588.                 reference  will  be  the  value  that  was assigned plus the
  589.                 number of seconds since the assignment.
  590.  
  591.            SSSSHHHHEEEELLLLLLLL
  592.                 When the shell is invoked, it  scans  the  environment  (see
  593.                 _E_n_v_i_r_o_n_m_e_n_t  below) for this name.  If it is found and there
  594.                 is an 'r' in the file name part  of  its  value,  the  shell
  595.                 becomes  a  restricted  shell.   The  shell  also  uses this
  596.                 variable to decide which program to spawn to interpret shell
  597.                 scripts (see _E_x_e_c_u_t_i_o_n below).
  598.  
  599.            TTTTMMMMPPPP  The location of temporary files created by  the  shell.   If
  600.                 this  variable  is  not  defined,  the  Shell  uses the HHHHOOOOMMMMEEEE
  601.                 directory for  temporary  files.   Failing  that,  the  root
  602.                 directory of the current drive is used.
  603.  
  604.       The shell gives default values to PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, SSSSHHHHEEEELLLLLLLL, HHHHOOOOMMMMEEEE and IIIIFFFFSSSS.
  605.  
  606.     AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEExxxxppppaaaannnnssssiiiioooonnnn
  607.       A string of the form $$$$((((((((_e_x_p)))))))) is substitued  with  the  value  of  the
  608.       arithemtic expression _e_x_p.  _e_x_p is treated as if it were within single
  609.       quotes.  See AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEEvvvvaaaalllluuuuaaaattttiiiioooonnnn below.
  610.  
  611.     BBBBllllaaaannnnkkkk IIIInnnntttteeeerrrrpppprrrreeeettttaaaattttiiiioooonnnn
  612.       After parameter and command substitution, the results of  substitution
  613.       are  scanned  for  internal field separator characters (those found in
  614.       IIIIFFFFSSSS) and split into  distinct  arguments  where  such  characters  are
  615.       found.   Explicit  null  arguments  ("""""""" or '''''''') are retained.  Implicit
  616.       null arguments (those resulting from _p_a_r_a_m_e_t_e_r_s that have  no  values)
  617.       are removed.
  618.  
  619.  
  620.                                    - 10 -         Formatted:  April 14, 1992
  621.  
  622.  
  623.  
  624.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  625.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  626.  
  627.  
  628.  
  629.     FFFFiiiilllleeee NNNNaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn
  630.       Following  substitution,  each  command  _w_o_r_d  is  scanned   for   the
  631.       characters ****, ???? and [[[[.  If one of these characters appears the word is
  632.       regarded as a _p_a_t_t_e_r_n.   The  word  is  replaced  with  alphabetically
  633.       sorted  file  names  that match the pattern.  If no file name is found
  634.       that matches the pattern, the word is left unchanged.  The character ....
  635.       at  the  start of a file name or immediately following a ////, as well as
  636.       the character //// itself, must be  matched  explicitly.   When  matching
  637.       patterns for file names, the shell ignores the case of the pattern and
  638.       the file directory entries.  Generated file names are always in  lower
  639.       case (for FAT file systems).  Under HPFS on OS/2, case is preserved.
  640.  
  641.            ****    Matches any string, including the null string.
  642.  
  643.            ????    Matches any single character.
  644.  
  645.            [[[[ ............ ]]]]
  646.                 Matches any one of  the  enclosed  characters.   A  pair  of
  647.                 characters  separated  by  ---- matches any character lexically
  648.                 between  the  pair,  inclusive.   If  the  first   character
  649.                 following  the  opening  ``[''  is a ````````!!!!'''''''' any character not
  650.                 enclosed is matched.
  651.  
  652.       If the shell has to open or create  the  file  ////ddddeeeevvvv////ttttttttyyyy  or  ////ddddeeeevvvv////nnnnuuuullllllll
  653.       (which  are  Unix special files), they are converted to the equivalent
  654.       MSDOS file names  (////ddddeeeevvvv////ccccoooonnnn  and  ////ddddeeeevvvv////nnnnuuuullll  respectively).   Any  user
  655.       programs which could expect ////ddddeeeevvvv////ttttttttyyyy or ////ddddeeeevvvv////nnnnuuuullllllll as arguments must do
  656.       its own mapping to the MSDOS equivalents.
  657.  
  658.     QQQQuuuuoooottttiiiinnnngggg
  659.       The following characters have a special meaning to the shell and cause
  660.       termination of a word unless quoted:
  661.  
  662.            ;;;;  &&&&  ((((  ))))  ||||  ^^^^  <<<<  >>>>  nnnneeeewwww----lllliiiinnnneeee  ssssppppaaaacccceeee  ttttaaaabbbb
  663.  
  664.       A character may  be  _q_u_o_t_e_d  (i.e.,  made  to  stand  for  itself)  by
  665.       preceding it with a \\\\.  The pair \\\\nnnneeeewwww----lllliiiinnnneeee is ignored.  All characters
  666.       enclosed between a pair of single quote marks (''''''''),  except  a  single
  667.       quote,  are  quoted.   Inside  double  quote marks (""""""""), parameter and
  668.       command substitution occurs and \\\\ quotes the characters \\\\, ````,  """",  and
  669.       $$$$.  """"$$$$****""""  is  equivalent to """"$$$$1111 $$$$2222 ............"""", whereas """"$$$$@@@@"""" is equivalent to
  670.       """"$$$$1111"""" """"$$$$2222"""" .............
  671.  
  672.     AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEEvvvvaaaalllluuuuaaaattttiiiioooonnnn
  673.       An ability to perform integer arithmetic is provided with the  special
  674.       command   lllleeeetttt.   Evaluations  are  performed  using  _l_o_n_g  arithmetic.
  675.       Constants are of the form [_b_a_s_e]_n  where  _b_a_s_e  is  a  decimal  number
  676.       between two and thirty-six representing the arithmetic base and _n is a
  677.       number in that base.  If [_b_a_s_e] is omitted then base 10 is used.
  678.  
  679.  
  680.  
  681.  
  682.                                    - 11 -         Formatted:  April 14, 1992
  683.  
  684.  
  685.  
  686.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  687.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  688.  
  689.  
  690.  
  691.       An arithmetic expression uses nearly the same syntax  precedence,  and
  692.       associatively  of  expression  as  C.  The following set of operators,
  693.       listed in order of decreasing precedence, have been implemented:
  694.  
  695.       - + ! ~ ++ --     unary    minus/plus,    logical     NOT,
  696.                         complement, {pre, post}{in,de}crement
  697.       &                 Logical AND
  698.       ^                 Logical XOR
  699.       |                 Logical OR
  700.       *  /  %           multiplication, division, remainder
  701.       +  -              addition, subtraction
  702.       << >>             Logical shift left and right
  703.       <=  >=  <  >      comparison
  704.       ==  !=            equality  inequality
  705.       &&                Logical AND
  706.       || ^^             Logical OR, XOR
  707.       ? :               Ternary operator
  708.       = += -=  *=  /=   assignement
  709.       %= &= ^= |= <<=
  710.       >>= &&= ||= ^^=
  711.  
  712.       The operators &&&&&&&&, ||||||||, &&&&&&&&==== and ||||||||==== are short-circuiting and only one of
  713.       the  latter  two expressions in a ternary operator is evaluated.  Note
  714.       the precedence of the logical AND, XOR and OR operators.
  715.  
  716.       Sub-expressions in parentheses () are evaluated first and can be  used
  717.       to override the above precedence rules.
  718.  
  719.       Named parameters can be reference by name within an expression without
  720.       using the parameter substitution symtax.
  721.  
  722.       Since many of the arithmetic operators require quoting, an alternative
  723.       form  of  the  lllleeeetttt  command is provided.  For any command which begins
  724.       with a ((((((((, all the characters until a matching ))))))))  are  treated  as  a
  725.       quoted  expression.   More  precisely,  ((((((((............))))))))   is equivalent to lllleeeetttt
  726.       """"............"""".
  727.  
  728.     PPPPrrrroooommmmppppttttiiiinnnngggg
  729.       When used interactively, the shell  prompts  with  the  value  of  PPPPSSSS1111
  730.       before  reading  a  command.   If  at any time a new-line is typed and
  731.       further input is needed to complete a command,  the  secondary  prompt
  732.       (i.e., the value of PPPPSSSS2222) is issued.
  733.  
  734.       Many  people  like  to  have  the  shell  provide  them  with   useful
  735.       information   in   their  prompt.   To  accommodate  this,  the  shell
  736.       recognises special sequences of characters in the values  of  PPPPSSSS1111  and
  737.       PPPPSSSS2222,  and  substitutes  the  appropriate  information  for  them.  The
  738.       special sequences and what they signify are:
  739.  
  740.            %%%%dddd   Place the current date, in the form DAY  DD-MM-YY  into  the
  741.                 prompt.
  742.  
  743.  
  744.                                    - 12 -         Formatted:  April 14, 1992
  745.  
  746.  
  747.  
  748.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  749.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  750.  
  751.  
  752.  
  753.            %%%%eeee   Place the current event number (as defined  by  the  hhhhiiiissssttttoooorrrryyyy
  754.                 command)  into  the  prompt.  If history evaluation has been
  755.                 turned off (via hhhhiiiissssttttoooorrrryyyy ----dddd), no number will  be  substituted
  756.                 in (i.e. the %%%%eeee will be removed).
  757.  
  758.            %%%%nnnn   Place the current working drive into the prompt.
  759.  
  760.            %%%%pppp   Place the current working directory into the prompt.
  761.  
  762.            %%%%tttt   Place the current time of day, in the form  HH:MM  into  the
  763.                 prompt.   The  time  is on a 24 hour clock, i.e. 1:30 in the
  764.                 afternoon will be 13:30.
  765.  
  766.            %%%%vvvv   Place the MSDOS version number, in  the  form   MSDOS  MM:MM
  767.                 into the prompt.
  768.  
  769.            %%%%%%%%   Place the character % into the prompt.
  770.  
  771.            \\\\xxxxxxxxxxxx Place the character _\_x_x_x into the prompt.  The processing of
  772.                 escape sequences is the same as that for eeeecccchhhhoooo.
  773.  
  774.       Some of these facilities are of more use than others.
  775.  
  776.     IIIInnnnppppuuuutttt////OOOOuuuuttttppppuuuutttt
  777.       Before a command is executed, its input and output may  be  redirected
  778.       using  a special notation interpreted by the shell.  The following may
  779.       appear anywhere in a simple-command or may precede or follow a _c_o_m_m_a_n_d
  780.       and  are  _n_o_t  passed  on  to the invoked command; substitution occurs
  781.       before _w_o_r_d or _d_i_g_i_t is used:
  782.  
  783.       <<<<wwwwoooorrrrdddd         Use file _w_o_r_d as standard input (file descriptor 0).
  784.  
  785.       >>>>wwwwoooorrrrdddd         Use file _w_o_r_d as standard output  (file  descriptor  1).
  786.                     If  the file does not exist it is created; otherwise, it
  787.                     is truncated to zero length.
  788.  
  789.       >>>>>>>>wwwwoooorrrrdddd        Use file _w_o_r_d as standard output.  If  the  file  exists
  790.                     output  is  appended to it (by first seeking to the end-
  791.                     of-file); otherwise, the file is created.
  792.  
  793.       <<<<<<<<[----]wwwwoooorrrrdddd     The shell input is read up to a line that is the same as
  794.                     _w_o_r_d,  or  to  an  end-of-file.   The resulting document
  795.                     becomes the standard input.  If any character of _w_o_r_d is
  796.                     quoted,  no interpretation is placed upon the characters
  797.                     of  the  document;  otherwise,  parameter  and   command
  798.                     substitution  occurs,  (unescaped) \\\\nnnneeeewwww----lllliiiinnnneeee is ignored,
  799.                     and \\\\ must be used to quote the characters \\\\, $$$$, ````,  and
  800.                     the  first  character  of _w_o_r_d.  If ---- is appended to <<<<<<<<,
  801.                     all leading tabs are stripped from  _w_o_r_d  and  from  the
  802.                     document.
  803.  
  804.  
  805.  
  806.                                    - 13 -         Formatted:  April 14, 1992
  807.  
  808.  
  809.  
  810.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  811.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  812.  
  813.  
  814.  
  815.       <<<<&&&&ddddiiiiggggiiiitttt       Use the file associated with file  descriptor  _d_i_g_i_t  as
  816.                     standard input.  Similarly for the standard output using
  817.                     >>>>&&&&ddddiiiiggggiiiitttt.
  818.  
  819.       <<<<&&&&----            The  standard  input  is  closed.   Similarly  for  the
  820.                     standard output using >>>>&&&&----.
  821.  
  822.       nnnn<<<<>>>>wwwwoooorrrrdddd       causes the file _w_o_r_d to be opened on file  descriptor  _n
  823.                     for  both  reading  and  writing.  The file must already
  824.                     exist.
  825.  
  826.       If any of the above is preceded by a digit, the file descriptor  which
  827.       will  be  associated  with  the  file  is  that specified by the digit
  828.       (instead of the default 0 or 1).  For example:
  829.  
  830.            ... 2>&1
  831.  
  832.       associates file descriptor 2 with the file currently  associated  with
  833.       file descriptor 1.
  834.  
  835.       The order in which redirections are  specified  is  significant.   The
  836.       shell evaluates redirections left-to-right.  For example:
  837.  
  838.            ... 1>_x_x_x 2>&1
  839.  
  840.       first associates file descriptor 1 with file _x_x_x.  It associates  file
  841.       descriptor  2  with  the  file associated with file descriptor 1 (i.e.
  842.       _x_x_x).  If the order of redirections were reversed, file  descriptor  2
  843.       would  be associated with the terminal (assuming file descriptor 1 had
  844.       been) and file descriptor 1 would be associated with file _x_x_x .
  845.  
  846.       The environment for the execution  of  a  command  contains  the  file
  847.       descriptors   of  the  invoking  shell  as  modified  by  input/output
  848.       specifications.
  849.  
  850.       Redirection of output is not allowed in the restricted shell.
  851.  
  852.     EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt
  853.       The _e_n_v_i_r_o_n_m_e_n_t (see _e_n_v_i_r_o_n(5)) is a list of name-value pairs that is
  854.       passed  to  an  executed  program in the same way as a normal argument
  855.       list.  The shell interacts with the environment in several  ways.   On
  856.       invocation,  the  shell  scans the environment and creates a parameter
  857.       for each name found, giving it the corresponding value.  If  the  user
  858.       modifies  the  value  of  any  of  these  parameters  or  creates  new
  859.       parameters, none of these affects the environment  unless  the  eeeexxxxppppoooorrrrtttt
  860.       command  is used to bind the shell's parameter to the environment (see
  861.       also sssseeeetttt ----aaaa).  A parameter may be removed from  the  environment  with
  862.       the  uuuunnnnsssseeeetttt  command.   The environment seen by any executed command is
  863.       thus composed of any unmodified name-value pairs originally  inherited
  864.       by the shell, minus any pairs removed by uuuunnnnsssseeeetttt, plus any modifications
  865.       or additions, all of which must be noted in eeeexxxxppppoooorrrrtttt commands.
  866.  
  867.  
  868.                                    - 14 -         Formatted:  April 14, 1992
  869.  
  870.  
  871.  
  872.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  873.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  874.  
  875.  
  876.  
  877.       The environment for any _s_i_m_p_l_e-_c_o_m_m_a_n_d may be augmented  by  prefixing
  878.       it with one or more assignments to parameters.  Thus:
  879.  
  880.            TERM=450 cmd args                                         and
  881.            (export TERM; TERM=450; cmd args)
  882.  
  883.       are equivalent (as far as the execution of _c_m_d is concerned).
  884.  
  885.       If the ----kkkk flag is  set,  _a_l_l  keyword  arguments  are  placed  in  the
  886.       environment, even if they occur after the command name.  The following
  887.       first prints aaaa====bbbb cccc and cccc:
  888.  
  889.            echo a=b c
  890.            set -k
  891.            echo a=b c
  892.  
  893.     SSSSiiiiggggnnnnaaaallllssss
  894.       The INTERRUPT and QUIT signals for an invoked command are  ignored  if
  895.       the  command  is  followed  by  &&&&;  otherwise  signals have the values
  896.       inherited by the shell from its parent, with the exception  of  signal
  897.       11 (but see also the ttttrrrraaaapppp command below).
  898.  
  899.     CCCCoooommmmmmmmaaaannnndddd RRRReeee----eeeennnnttttrrrryyyy
  900.       The text of the last 100 commands entered from a  terminal  device  is
  901.       saved  in  a  _h_i_s_t_o_r_y  file.  The file $$$$HHHHOOOOMMMMEEEE////hhhhiiiissssttttoooorrrryyyy....sssshhhh is used if the
  902.       HHHHIIIISSSSTTTTFFFFIIIILLLLEEEE variable is not set.  The special command ffffcccc is used to  list
  903.       or  edit a portion of this file.  The portion of the file to be edited
  904.       or listed can be selected by number or by giving the  first  character
  905.       or  characters  of the command.  A single command or range of commands
  906.       can be specified.  If you do not  specify  an  editor  program  as  an
  907.       argument to ffffcccc, the value of the parameter FFFFCCCCEEEEDDDDIIIITTTT is used.  The edited
  908.       command is printed and  re-executed  upon  leaving  the  editor.   The
  909.       editor  name ---- is used to skip the editing phase and to re-execute the
  910.       command.  In this case a substitution parameter of  the  form  _o_l_d====_n_e_w
  911.       can be used to modify the command before execution.  For example, if rrrr
  912.       is aliased to ````ffffcccc ----eeee ----'''', typing `rrrr bbbbaaaadddd====ggggoooooooodddd cccc'  re-executes  the  most
  913.       recent  command  that  starts with the letter cccc and replaces the first
  914.       occurrence of the string bbbbaaaadddd with the string ggggoooooooodddd.
  915.  
  916.     HHHHiiiissssttttoooorrrryyyy
  917.       When reading input from an interactive terminal, a ``!'' at the  start
  918.       of  a  line  signals  to the shell that it should attempt to perform a
  919.       history subsitution.  A history subsitution  is  a  short-hand  method
  920.       which  allows  the  user to recall a previous command for execution or
  921.       editing.  The recalled command is  placed  in  the  command  line  for
  922.       editing  or passing to the rest of the shell for normal processing.  A
  923.       history substitution takes the form:
  924.  
  925.            !!!! [ ! | _s_t_r | _n_u_m ] _t_e_r_m_i_n_a_t_o_r
  926.  
  927.  
  928.  
  929.  
  930.                                    - 15 -         Formatted:  April 14, 1992
  931.  
  932.  
  933.  
  934.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  935.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  936.  
  937.  
  938.  
  939.       !!!!!!!! will place the previous command in the  command  line.   !!!!_n_u_m  will
  940.       place  the  history  command  with the specified number in the command
  941.       line.  !!!!_s_t_r will find the most recent command line that  started  with
  942.       the characters in _s_t_r.
  943.  
  944.       The _t_e_r_m_i_n_a_t_o_r determines what action is performed after  the  history
  945.       line has been found.  If the original history command is entered using
  946.       the <<<<rrrreeeettttuuuurrrrnnnn>>>> key, the new command  line  is  passed  directly  to  the
  947.       shell.   If  the  <<<<eeeennnndddd>>>>  key  is  pressed, the new command line can be
  948.       edited in the manner described below.
  949.  
  950.     CCCCoooommmmmmmmaaaannnndddd LLLLiiiinnnneeee EEEEddddiiiittttiiiinnnngggg
  951.       When reading input from an interactive  terminal,  certain  keystrokes
  952.       allow  the  current input line to be edited.  The following keystrokes
  953.       corresponding  to  the  following  functions  are   defined   in   the
  954.       initialisation  file  sssshhhh....iiiinnnniiii.  The keywords in the initialisation file
  955.       which provide the functions are listed below:
  956.  
  957.       RRRRiiiigggghhhhtttt
  958.            Move the cursor right one character
  959.  
  960.       WWWWoooorrrrddddRRRRiiiigggghhhhtttt
  961.            Move the cursor right one word
  962.  
  963.       LLLLeeeefffftttt Move the cursor left one character
  964.  
  965.       WWWWoooorrrrddddLLLLeeeefffftttt
  966.            Move the cursor left one word
  967.  
  968.       PPPPrrrreeeevvvviiiioooouuuussss
  969.            Get the previous command from the history file
  970.  
  971.       NNNNeeeexxxxtttt Get the next command from the history file
  972.  
  973.       IIIInnnnsssseeeerrrrtttt
  974.            Toggle insert/overwrite  mode  (note  the  shape  of  the  cursor
  975.            changes to indicate the current mode)
  976.  
  977.       DDDDeeeelllleeeetttteeeeRRRRiiiigggghhhhtttt
  978.            Delete the current character unless the cursor is at the  end  of
  979.            line when no action is taken
  980.  
  981.       SSSSttttaaaarrrrtttt
  982.            Move the cursor to the start of the command
  983.  
  984.       CCCCoooommmmpppplllleeeetttteeee
  985.            Attempt to complete the filename.  The shell attempts to complete
  986.            the  file  name at the current cursor position.  The file name is
  987.            delimited by white space characters.  If the shell is  unable  to
  988.            complete  the  file  name  (ie  no  match  can  be  found  in the
  989.            appropriate directory), the bell is rung.  If a single  match  is
  990.  
  991.  
  992.                                    - 16 -         Formatted:  April 14, 1992
  993.  
  994.  
  995.  
  996.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  997.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  998.  
  999.  
  1000.  
  1001.            found,  the  new file name is displayed.  If multiple matches are
  1002.            found, the file name is replaced by the longest  non-unique  part
  1003.            of the file name and the bell is rung.
  1004.  
  1005.       EEEEnnnndddd  Move the cursor to the end  of  the  command,  unless  the  first
  1006.            character  of  the  command is a !!!!, in which case the appropriate
  1007.            history search is done.  The cursor is placed at the end  of  the
  1008.            command line.
  1009.  
  1010.       FFFFlllluuuusssshhhh
  1011.            Delete to the end of the line
  1012.  
  1013.       SSSSccccaaaannnnBBBBaaaacccckkkkwwwwaaaarrrrdddd
  1014.            Search backwards from the current history command  for  the  next
  1015.            match against the last history request or the string currently in
  1016.            the command line if there has been no previous history request.
  1017.  
  1018.       SSSSccccaaaannnnFFFFoooorrrreeeewwwwaaaarrrrdddd
  1019.            Search forewards from the current history command  for  the  next
  1020.            match against the last history request or the string currently in
  1021.            the command line if there has been no previous history request.
  1022.  
  1023.       CCCClllleeeeaaaarrrr
  1024.            Erase the complete line.
  1025.  
  1026.       DDDDiiiirrrreeeeccccttttoooorrrryyyy
  1027.            Display the file name list matching the  partially  entered  file
  1028.            name under the cursor.  If no matches are found the bell is rung.
  1029.            To display the whole directory, enter the directory name followed
  1030.            by  a  slash  ////.  After the directory listing has been displayed,
  1031.            the entered command line is redisplayed.
  1032.  
  1033.       DDDDeeeelllleeeetttteeeeLLLLeeeefffftttt
  1034.            Delete the character to the left of the cursor.
  1035.  
  1036.       RRRReeeettttuuuurrrrnnnn
  1037.            Execute the command line,  unless  the  first  character  of  the
  1038.            command  is a !!!!, in which case the appropriate history processing
  1039.            is done.  _T_h_i_s _i_s _t_h_e _a_c_t_u_a_l _k_e_y _p_r_e_s_s_e_d _a_n_d _c_a_n_n_o_t  _b_e  _m_o_d_i_f_i_e_d
  1040.            _b_y _t_h_e _i_n_i_t_i_a_l_i_s_a_t_i_o_n _f_i_l_e.
  1041.  
  1042.     IIIInnnniiiittttiiiiaaaalllliiiissssaaaattttiiiioooonnnn FFFFiiiilllleeee
  1043.       When the shell is run in interactive mode, the  Command  Line  Editing
  1044.       keys  and  other  user  configuration  parameters  are  read  from the
  1045.       initialisation file _s_h._i_n_i.  This shell looks for  this  file  in  the
  1046.       same directory as the sssshhhh executable which is running.  It does not use
  1047.       the SSSSHHHHEEEELLLLLLLL environment variable or search the directories in  the  PPPPAAAATTTTHHHH
  1048.       environment  variable.   At  present,  there are two types of entry in
  1049.       this file: keyboard configuration; and others.  The entry is contained
  1050.       in  a  single line and consists of a keyword (in upper or lower case),
  1051.       white space, an equals symbols, white space and  one  or  two  numeric
  1052.  
  1053.  
  1054.                                    - 17 -         Formatted:  April 14, 1992
  1055.  
  1056.  
  1057.  
  1058.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1059.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1060.  
  1061.  
  1062.  
  1063.       values  (see  _s_t_r_t_o_l  for valid formats where _b_a_s_e parameter is zero),
  1064.       followed by an end of line character.
  1065.  
  1066.       For the keyboard entries, the numeric values give the MSDOS Function 8
  1067.       (Console  Input without Echo) return values for that entry.  Note that
  1068.       extended codes (function keys) require two  calls  to  this  function.
  1069.       The  first call returns zero and the second the extended code.  In the
  1070.       configuration file, a first numeric value of zero indicates a extended
  1071.       code and must be followed by a second value.  A non-zero first numeric
  1072.       value must not be followed by anything else on the line.
  1073.  
  1074.       Other entries must only have one numeric value.  A zero value disables
  1075.       the  function  and a non-zero value enables the function.  At present,
  1076.       there are two other functions:
  1077.  
  1078.       BBBBeeeellllllll Enable/disable warning bells
  1079.  
  1080.       HHHHaaaallllffffHHHHeeeeiiiigggghhhhtttt
  1081.            Use full or halfheight block cursor to indicate Insert mode
  1082.  
  1083.       IIIInnnnsssseeeerrrrttttMMMMooooddddeeee
  1084.            Set the default insert mode on or off
  1085.  
  1086.       IIIInnnnsssseeeerrrrttttCCCCuuuurrrrssssoooorrrr
  1087.            Enable/disable the insert mode cursor.
  1088.  
  1089.       Invalid lines or lines beginning with a #### are ignored.
  1090.  
  1091.       The following table gives the list of valid keywords and their default
  1092.       values:
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.                                    - 18 -         Formatted:  April 14, 1992
  1117.  
  1118.  
  1119.  
  1120.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1121.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1122.  
  1123.       _________________________________________________________________________
  1124.        Keyword            First numeric   Second numeric   Actual Key
  1125.       _________________________________________________________________________
  1126.        KEYBOARD ENTRIES
  1127.        ScanBackward       0               0x49             PAGE UP
  1128.        ScanForeward       0               0x51             PAGE DOWN
  1129.        Previous           0               0x48             UP ARROW
  1130.        Next               0               0x50             DOWN ARROW
  1131.        Left               0               0x4b             LEFT ARROW
  1132.        Right              0               0x4d             RIGHT ARROW
  1133.        WordRight          0               0x74             Control RIGHT ARROW
  1134.        WordLeft           0               0x73             Control LEFT ARROW
  1135.        Start              0               0x47             HOME
  1136.        Clear              0               0x76             Control PAGE DOWN
  1137.        Flush              0               0x75             Control END
  1138.        End                0               0x4f             END
  1139.        Insert             0               0x52             INSERT
  1140.        DeleteRight        0               0x53             DELETE
  1141.        DeleteLeft         0x08                             BACKSPACE
  1142.        Complete           0               0x77             Control HOME
  1143.        Directory          0               0x0f             Shift TAB
  1144.       _________________________________________________________________________
  1145.        OTHER FUNCTIONS
  1146.        Bell               0
  1147.        HalfHeight         0
  1148.        InsertMode         0
  1149.        InsertCursor       1
  1150.       _________________________________________________________________________
  1151.  
  1152.     EEEExxxxeeeeccccuuuuttttiiiioooonnnn
  1153.       Each time a command is executed, the above substitutions  are  carried
  1154.       out.   If  the command name matches one of the _S_p_e_c_i_a_l _C_o_m_m_a_n_d_s listed
  1155.       below, it is executed in the shell process.  If the command name  does
  1156.       not  match  a  _S_p_e_c_i_a_l  _C_o_m_m_a_n_d,  but  matches  the  name of a defined
  1157.       function, the function is executed in the shell process (note how this
  1158.       differs  from  the  execution  of  shell  procedures).  The positional
  1159.       parameters $$$$1111, $$$$2222, ....  are set to the arguments of the function.  If
  1160.       the  command  name matches neither a _S_p_e_c_i_a_l _C_o_m_m_a_n_d nor the name of a
  1161.       defined function, a new process is created and an attempt is  made  to
  1162.       execute the command via _e_x_e_c(2).
  1163.  
  1164.       The shell parameter PPPPAAAATTTTHHHH defines the search  path  for  the  directory
  1165.       containing  the command.  Alternative directory names are separated by
  1166.       a semi-colon (;;;;).  The default path is ;;;;cccc::::////bbbbiiiinnnn;;;;cccc::::////uuuussssrrrr////bbbbiiiinnnn  (specifying
  1167.       the  current  directory, cccc::::////bbbbiiiinnnn, and cccc::::////uuuussssrrrr////bbbbiiiinnnn, in that order).  Note
  1168.       that the current directory is specified by a null path name, which can
  1169.       appear  immediately  after  the  equal  sign or between the semi-colon
  1170.       delimiters anywhere else in  the  path  list.   If  the  command  name
  1171.       contains  a //// or starts with xxxx:::: (where x is a drive letter) the search
  1172.       path is not used; such commands will not be executed by the restricted
  1173.       shell.   Otherwise,  each  directory  in  the  path is searched for an
  1174.       executable file.  Executable files are indicated by  a  .exe  or  .com
  1175.       extension.   This extension is automatically supplied by the shell and
  1176.  
  1177.  
  1178.                                    - 19 -         Formatted:  April 14, 1992
  1179.  
  1180.  
  1181.  
  1182.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1183.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1184.  
  1185.  
  1186.  
  1187.       not have to be entered by the user.
  1188.  
  1189.       If the file with a .com or .exe  extension  cannot  be  found  in  the
  1190.       directory,  the  file is opened and first 512 characters are read.  If
  1191.       there are no characters in the block with a value in the range 0 to 7,
  1192.       the  file  is  assumed  to be a script file containing shell commands.
  1193.       Note that the shell will check the file and  if  that  file  does  not
  1194.       exist  or  is  not a script, it will try the file with an extension of
  1195.       ....sssshhhh.  If a ....sssshhhh file is found, that will  be  processed.   A  sub-shell
  1196.       (given by the environment variable SSSSHHHHEEEELLLLLLLL) is spawned to read it.
  1197.  
  1198.       If the script file starts with the a line of the form  #!  _i_n_t_e_r_p_r_e_t_e_r
  1199.       [_a_r_g_u_m_e_n_t_s],  the  interpreter  is  invoked  instead  of  the shell to
  1200.       process the script.  Optional arguments can be supplied in the  script
  1201.       file  which  are  passed before the name of the script file.  Thus, if
  1202.       the file _d_e_m_o contained the following string as the first line
  1203.  
  1204.            #! perl -sP
  1205.  
  1206.       Entering _d_e_m_o _n_a_m_e would be equivalent to entering the _p_e_r_l  -_s_P  _n_a_m_e
  1207.       at  the  command  prompt.   Note that no other processing of the first
  1208.       line other that the separation (by  white  space)  into  arguments  is
  1209.       done.
  1210.  
  1211.       If none of the above conditions for a executable file are detected and
  1212.       a  file  with  a  .bat  extension exists in the directory, the command
  1213.       processor given by the CCCCOOOOMMMMSSSSPPPPEEEECCCC  environment  variable  is  spawned  to
  1214.       process  the file.  This is normally the standard MSDOS _c_o_m_m_a_n_d._c_o_m or
  1215.       OS/2 _c_m_d._e_x_e processor.
  1216.  
  1217.       A parenthesized command is also executed in a sub-shell.
  1218.  
  1219.     CCCCoooommmmmmmmaaaannnndddd LLLLiiiinnnneeee BBBBuuuuiiiillllddddiiiinnnngggg
  1220.       The  file  pointed  to  by  the   EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD____LLLLIIIINNNNEEEE   parameter   contains
  1221.       information  which  instructs  the  shell on how to create the command
  1222.       line for a particular program from  the  information  entered  to  the
  1223.       shell.   If  the  program name is not found in this file, the standard
  1224.       MSDOS or OS/2 mechanisms are used with no special processing.
  1225.  
  1226.       The file is scanned prior to the execution of an external command.  An
  1227.       entry  in  this  file  is contained in a single line and consists of a
  1228.       program name (in upper or lower case), white space, an equals  symbol,
  1229.       white  space  and  the  program  type  followed by up to four optional
  1230.       values, followed by an end of line character.   The  vvvvaaaalllluuuueeee  tells  the
  1231.       shell  how  to  build the command line and the optional values provide
  1232.       additional information.   The  valid  pppprrrrooooggggrrrraaaammmm  ttttyyyyppppeeeessss  are  (note  that
  1233.       invalid  entries  cause  a  line  to  be  ignored) given below.  These
  1234.       pppprrrrooooggggrrrraaaammmm ttttyyyyppppeeeessss must appear as the first  value  following  the  _e_q_u_a_l_s.
  1235.       Otherwise,  they  are ignored.  An empty pppprrrrooooggggrrrraaaammmm ttttyyyyppppeeeessss may be empty to
  1236.       only select one or more of the optional values.
  1237.  
  1238.  
  1239.  
  1240.                                    - 20 -         Formatted:  April 14, 1992
  1241.  
  1242.  
  1243.  
  1244.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1245.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1246.  
  1247.  
  1248.  
  1249.            uuuunnnniiiixxxx This program can process the command line using the indirect
  1250.                 command file character @@@@.  When a program, which can process
  1251.                 this format, finds a command line parameter starting with  a
  1252.                 @@@@  in  the command line, it treats the rest of the parameter
  1253.                 as a file and reads the command line  parameters  from  that
  1254.                 file  (one  per  line,  the  end  of  line characters can be
  1255.                 escaped  by  preceeding  with  a  \\\\).   Examples   of   this
  1256.                 functionality include the Standard LLLLiiiinnnnkkkkeeeerrrr and LLLLiiiibbbbrrrraaaarrrriiiiaaaannnn.
  1257.  
  1258.                 The file name is set up in  UNIX  format  (using  ////  as  the
  1259.                 directory separators).
  1260.  
  1261.                 This functionality allows the user to get round the 127 byte
  1262.                 command line length limit of MSDOS.  A sample version of the
  1263.                 code to process wild cards and  indirect  command  files  is
  1264.                 included with the source of the shell in the file _s_t_d_a_r_g_v._c.
  1265.  
  1266.            ddddoooossss  This program can process the command line using the indirect
  1267.                 command  file  character  @@@@.  The file name is set up in DOS
  1268.                 format (using \\\\s as the directory separators).
  1269.  
  1270.            eeeennnnvvvviiiirrrroooonnnn
  1271.                 The command line is passed to the external  program  in  the
  1272.                 environment  variable specified by the first optional value.
  1273.                 The optional  second  value  which  is  numeric,  gives  the
  1274.                 parameter  separator  character  to  be used (see _s_t_r_t_o_l for
  1275.                 valid formats where _b_a_s_e parameter is zero).  If this second
  1276.                 value is missing or evaluates to zero, space is used.
  1277.  
  1278.       The following optional values described below may be used after either
  1279.       uuuunnnniiiixxxx or ddddoooossss or by themselves:
  1280.  
  1281.            sssswwwwiiiittttcccchhhh
  1282.                 The optional value sssswwwwiiiittttcccchhhh causes the program  parameters  to
  1283.                 be  converted  from UUUUNNNNIIIIXXXX format to MMMMSSSSDDDDOOOOSSSS format.  This means
  1284.                 that parameters beginning with an ---- have it converted  to  a
  1285.                 ////.   For all other parameters, ////s are converted to \\\\s.  This
  1286.                 option is  not  applied  to  quoted  parameters  or  escaped
  1287.                 characters.
  1288.  
  1289.                 This functionality allows ease of entry  of  MSDOS  commands
  1290.                 which  expect  MSDOS  directory  separators  which the shell
  1291.                 interpretes as the escape character (not that the underlying
  1292.                 MSDOS  really  cares).   eeeexxxxppppoooorrrrtttt  The  optional  value eeeexxxxppppoooorrrrtttt
  1293.                 causes the marked environment variables to be converted from
  1294.                 UUUUNNNNIIIIXXXX  format to MMMMSSSSDDDDOOOOSSSS format.  This is equivalent to setting
  1295.                 the -m flag for this program only.
  1296.  
  1297.            nnnnooooeeeexxxxppppaaaannnndddd
  1298.                 The optional value nnnnooooeeeexxxxppppaaaannnndddd disables  file  name  generation
  1299.                 when building the command line (also see sssseeeetttt command).
  1300.  
  1301.  
  1302.                                    - 21 -         Formatted:  April 14, 1992
  1303.  
  1304.  
  1305.  
  1306.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1307.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1308.  
  1309.  
  1310.  
  1311.            nnnnoooosssswwwwaaaapppp
  1312.                 The optional value nnnnoooosssswwwwaaaapppp disables swapping for the command.
  1313.                 This may speed up the execution of small commands.
  1314.  
  1315.     FFFFuuuunnnnccccttttiiiioooonnnnssss
  1316.       The ffffuuuunnnnccccttttiiiioooonnnn _k_e_y_w_o_r_d, _d_e_s_c_r_i_b_e_d _i_n _t_h_e CCCCoooommmmmmmmaaaannnnddddssss section above, is used
  1317.       to  define  shell  functions.   Shell functions are read in and stored
  1318.       internally.  Alias names are  resolved  when  the  function  is  read.
  1319.       Functions  are  executed  like  commands  with the arguments passed as
  1320.       positional parameters.  (See EEEExxxxeeeeccccuuuuttttiiiioooonnnn above).
  1321.  
  1322.       Functions execute in the same process as  the  caller  and  share  all
  1323.       files  and present working directory with the caller.  Traps caught by
  1324.       the caller are reset to their default action inside the  function.   A
  1325.       trap  condition  that  is not caught or ignored by the function causes
  1326.       the function to terminate and the condition to be  passed  on  to  the
  1327.       caller.   A  trap  set on EXIT inside a function is executed after the
  1328.       function completes.
  1329.  
  1330.       Ordinarily, variables are shared between the calling program  and  the
  1331.       function.  However, the ttttyyyyppppeeeesssseeeetttt special command used within a function
  1332.       defines local variables whose scope includes the current function  and
  1333.       all functions it calls.
  1334.  
  1335.       The special command rrrreeeettttuuuurrrrnnnn is used  to  return  from  function  calls.
  1336.       Errors within functions return control to the caller.
  1337.  
  1338.       Function identifiers can be listed with the ffffuuuunnnnccccttttiiiioooonnnn special  command.
  1339.       The  text of functions will also be listed.  Function can be undefined
  1340.       with the uuuunnnnffffuuuunnnnccccttttiiiioooonnnn special command.
  1341.  
  1342.       Ordinarily, functions are  unset  when  the  shell  executes  a  shell
  1343.       script.  Functions that need to be defined across separate invocations
  1344.       of the shell should be placed in the EEEENNNNVVVV file.
  1345.  
  1346.     SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss
  1347.       Input/output  redirection  is  permitted  for  these  commands.   File
  1348.       descriptor 1 is the default output location.
  1349.  
  1350.       ::::    No effect; the  command  does  nothing.   A  zero  exit  code  is
  1351.            returned.
  1352.  
  1353.       _l_e_t_t_e_r::::
  1354.            Select the drive specified by _l_e_t_t_e_r.
  1355.  
  1356.       .... _f_i_l_e
  1357.            Read and execute commands from _f_i_l_e and return.  The search  path
  1358.            specified by PPPPAAAATTTTHHHH is used to find the directory containing _f_i_l_e.
  1359.  
  1360.       aaaalllliiiiaaaassss [ ----tttt ] [ _n_a_m_e[=_v_a_l_u_e ] ... ]
  1361.            AAAAlllliiiiaaaassss with no arguments prints the list of aliases  in  the  form
  1362.  
  1363.  
  1364.                                    - 22 -         Formatted:  April 14, 1992
  1365.  
  1366.  
  1367.  
  1368.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1369.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1370.  
  1371.  
  1372.  
  1373.            _n_a_m_e=vvvvaaaalllluuuueeee on standard output.  An alias is defined for each _n_a_m_e
  1374.            whose _v_a_l_u_e is given.  A trailing space in _v_a_l_u_e causes the  next
  1375.            word  to  be checked for alias substitution.  The ----tttt flag is used
  1376.            to set and list tracked aliases.  The _v_a_l_u_e of a tracked alias is
  1377.            the  full  pathname  corresponding  to the given name.  The _v_a_l_u_e
  1378.            becomes undefined when the _v_a_l_u_e of PATH is reset but the aliases
  1379.            remained  tracked.   Without  the  ----tttt  flag, for each _n_a_m_e in the
  1380.            argument list for which no _v_a_l_u_e is given, the _n_a_m_e and _v_a_l_u_e  of
  1381.            the  alias is printed.  Alias returns zero unless a _n_a_m_e is given
  1382.            for which no alias has been defined.
  1383.  
  1384.       bbbbrrrreeeeaaaakkkk [ _n ]
  1385.            Exit from the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee  loop,  if  any.   If  _n  is
  1386.            specified, break _n levels.
  1387.  
  1388.       bbbbuuuuiiiillllttttiiiinnnn [ _a_r_g_s ... ]
  1389.            Force the selection of the bbbbuuuuiiiillllttttiiiinnnn version  of  a  command.   The
  1390.            builtin  shell  command  selected  by  the  first  _a_r_g_s  value is
  1391.            executed with the parameters defined by the remaining _a_r_g_ss.   If
  1392.            no  arguments  are  given,  a  list  of  all  _b_u_i_l_t_i_n commands is
  1393.            printed.
  1394.  
  1395.            If the first argument is one of the following, the processing  of
  1396.            the  builtin  command  in  the following arguments are changed as
  1397.            indicated:
  1398.  
  1399.            ----aaaa   Set the following builtin commands to use builtin version in
  1400.                 preference to any function or external versions.
  1401.  
  1402.            ----dddd   Set the following builtin commands to use  the  function  or
  1403.                 external version in preference to the builtin version.
  1404.  
  1405.            ----ssss    Display  the  current  status  of  the  following   builtin
  1406.                 commands.
  1407.  
  1408.       ccccoooonnnnttttiiiinnnnuuuueeee [ _n ]
  1409.            Resume the next iteration of the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee loop.  If
  1410.            _n is specified, resume at the _n-th enclosing loop.
  1411.  
  1412.       ccccdddd [ _a_r_g ]
  1413.       ccccdddd _s_e_a_r_c_h _r_e_p_l_a_c_e
  1414.            This command can be in either of two forms.  In the first form it
  1415.            changes  the  current directory to _a_r_g.  The shell parameter HHHHOOOOMMMMEEEE
  1416.            is the default _a_r_g.   The  shell  parameter  CCCCDDDDPPPPAAAATTTTHHHH  defines  the
  1417.            search  path  for  the  directory  containing  _a_r_g.   Alternative
  1418.            directory names are separated by a semi-colon (;;;;).   The  default
  1419.            path is <<<<nnnnuuuullllllll>>>> (specifying the current directory).  Note that the
  1420.            current directory is specified by a null  path  name,  which  can
  1421.            appear immediately after the equal sign or between the semi-colon
  1422.            delimiters anywhere else in the path list.  If _a_r_g begins with  a
  1423.            //// or xxxx:::: (where x is a drive letter), the search path is not used.
  1424.  
  1425.  
  1426.                                    - 23 -         Formatted:  April 14, 1992
  1427.  
  1428.  
  1429.  
  1430.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1431.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1432.  
  1433.  
  1434.  
  1435.            Otherwise, each directory in the path is searched for  _a_r_g.   The
  1436.            _c_d command may not be executed by _r_s_h.
  1437.  
  1438.            In the second form, ccccdddd substitutes the  string  _r_e_p_l_a_c_e  for  the
  1439.            string  _s_e_a_r_c_h  in  the  current directory name, PPPPWWWWDDDD and tries to
  1440.            change to this new directory.
  1441.  
  1442.       ddddeeeettttaaaacccchhhh _p_r_o_g_r_a_m [ _a_r_g_s ]
  1443.            This command (which is only  available  under  OS/2)  starts  and
  1444.            simultaneously  detaches  an  OS/2  _p_r_o_g_r_a_m  from the shell.  Any
  1445.            _p_r_o_g_r_a_m that is started with  ddddeeeettttaaaacccchhhh  command  must  be  able  to
  1446.            process  independently outside the control of the shell.  Builtin
  1447.            shell commands and functions cannot be detached.
  1448.  
  1449.       eeeecccchhhhoooo [ _a_r_g ... ]
  1450.            Echo arguments. EEEEcccchhhhoooo writes its arguments separated by blanks and
  1451.            terminated  by  a  new-line  on  the  standard  output.   It also
  1452.            understands C-like escape conventions; beware of  conflicts  with
  1453.            the shell's use of \\\\:
  1454.  
  1455.            \\\\bbbb   backspace
  1456.            \\\\cccc   print line without new-line
  1457.            \\\\ffff   form-feed
  1458.            \\\\nnnn   new-line
  1459.            \\\\rrrr   carriage return
  1460.            \\\\tttt   tab
  1461.            \\\\vvvv   vertical tab
  1462.            \\\\\\\\   backslash
  1463.            \\\\_n   the 8-bit character whose ASCII code is the  1-,  2-  or  3-
  1464.                 digit octal number _n, which must start with a zero.
  1465.  
  1466.                 _E_c_h_o is useful for producing diagnostics  in  command  files
  1467.                 and for sending known data into a pipe.
  1468.  
  1469.       eeeevvvvaaaallll [ _a_r_g ... ]
  1470.            The arguments are read as input to the shell  and  the  resulting
  1471.            command(s) executed.
  1472.  
  1473.       eeeexxxxeeeecccc [ _a_r_g ... ]
  1474.            The command specified by the arguments is executed  in  place  of
  1475.            this   shell   without  creating  a  new  process.   Input/output
  1476.            arguments may appear and, if no other arguments are given,  cause
  1477.            the shell input/output to be modified.
  1478.  
  1479.       eeeexxxxiiiitttt [ _n ]
  1480.            Causes a shell to exit with the exit status specified by _n.  If _n
  1481.            is  omitted  the exit status is that of the last command executed
  1482.            (an end-of-file will also cause the shell to exit.)
  1483.  
  1484.       eeeexxxxppppoooorrrrtttt [ _n_a_m_e[=_v_a_l_u_e] ... ]
  1485.            The  given  _n_a_m_es  are  marked  for  automatic  export   to   the
  1486.  
  1487.  
  1488.                                    - 24 -         Formatted:  April 14, 1992
  1489.  
  1490.  
  1491.  
  1492.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1493.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1494.  
  1495.  
  1496.  
  1497.            _e_n_v_i_r_o_n_m_e_n_t  of  subsequently-executed commands.  If no arguments
  1498.            are given, a list of all names that are exported in this shell is
  1499.            printed.  Function names may _n_o_t be exported.
  1500.  
  1501.       ffffaaaallllsssseeee
  1502.            No effect; the command does nothing.  A  non-zero  exit  code  is
  1503.            returned.
  1504.  
  1505.       ffffcccc [ ----eeee _E_d_i_t_o_r_N_a_m_e ] [ ----nnnnllllrrrr ] [ _F_i_r_s_t [ _L_a_s_t ] ]
  1506.       ffffcccc ----eeee ---- [ _O_l_d=_N_e_w ] [ _C_o_m_m_a_n_d ]
  1507.            In the first form, a range of commands  from  _F_i_r_s_t  to  _L_a_s_t  is
  1508.            selected  from  the  last  100  commands  that  were typed at the
  1509.            terminal.  The _F_i_r_s_t and _L_a_s_t parameters can be  specified  as  a
  1510.            number  or as a string.  A string locates the most recent command
  1511.            starting with the given string.  A negative number is used as  an
  1512.            offset  to the current command number.  If _L_a_s_t is not specified,
  1513.            then it is set to _F_i_r_s_t.  If _F_i_r_s_t is not specified, the  default
  1514.            is the previous command for editing and -16 for listing.
  1515.  
  1516.            ----llll   Lists the commands to standard output.
  1517.  
  1518.            ----rrrr   Reverses the order of the commands in the list.
  1519.  
  1520.            ----nnnn   Suppresses command numbers when listing.
  1521.  
  1522.            If the ----llll flag is not specified, the editor program specified  by
  1523.            _E_d_i_t_o_r_N_a_m_e  is  invoked  on  a  file  containing  these key-board
  1524.            commands.  If _E_d_i_t_o_r_N_a_m_e is not supplied, then the value  of  the
  1525.            FFFFCCCCEEEEDDDDIIIITTTT  parameter  is  used  as  the  editor.   When  editing  is
  1526.            complete, the edited command(s) is executed.
  1527.  
  1528.            In the second form, the specified _c_o_m_m_a_n_d is  carried  out  again
  1529.            after the _O_l_d=_N_e_w substitution is performed.
  1530.  
  1531.       ffffuuuunnnnccccttttiiiioooonnnnssss [ _n_a_m_e ... ]
  1532.            The functions given by _n_a_m_es are printed.  If  no  arguments  are
  1533.            given, a all the functions are displayed.
  1534.  
  1535.       ggggeeeettttoooopppptttt _o_p_t_s_t_r_i_n_g _n_a_m_e [ _a_r_g_s ... ]
  1536.            Parse command options and write them to standard output.   GGGGeeeettttoooopppptttt
  1537.            is  used to break up options in command lines for easy parsing by
  1538.            shell procedures and to check for legal options.  _O_p_t_s_t_r_i_n_g is  a
  1539.            string of recognized option letters (see _g_e_t_o_p_t(3C)); if a letter
  1540.            is followed by a  colon,  the  option  is  expected  to  have  an
  1541.            argument  which  may  or  may  not  be separated from it by white
  1542.            space.  The special option -------- is used to delimit the end  of  the
  1543.            options.   If  it  is  used explicitly, ggggeeeettttoooopppptttt will recognize it;
  1544.            otherwise, ggggeeeettttoooopppptttt will generate it; in either case,  ggggeeeettttoooopppptttt  will
  1545.            place it at the end of the options.  Each option is preceded by a
  1546.            ---- and is in its own positional parameter; each option argument is
  1547.            also parsed into its own positional parameter.
  1548.  
  1549.  
  1550.                                    - 25 -         Formatted:  April 14, 1992
  1551.  
  1552.  
  1553.  
  1554.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1555.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1556.  
  1557.  
  1558.  
  1559.            The following code fragment  shows  how  one  might  process  the
  1560.            arguments for a command that can take the options aaaa or bbbb, as well
  1561.            as the option oooo, which requires an argument:
  1562.  
  1563.            set -- `getopt abo: $*`
  1564.            if [ $? != 0 ]
  1565.            then
  1566.                 echo $USAGE
  1567.                 exit 2
  1568.            fi
  1569.            for i in $*
  1570.            do
  1571.                 case $i in
  1572.                 -a | -b)  FLAG=$i; shift;;
  1573.                 -o)       OARG=$2; shift 2;;
  1574.                 --)       shift; break;;
  1575.                 esac
  1576.            done
  1577.  
  1578.            This code will accept any of the following as equivalent:
  1579.  
  1580.            cmd -aoarg file file
  1581.            cmd -a -o arg file file
  1582.            cmd -oarg -a file file
  1583.            cmd -a -oarg -- file file
  1584.  
  1585.       hhhhiiiissssttttoooorrrryyyy [ ----ddddeeeeiiiillllssss ]
  1586.            The hhhhiiiissssttttoooorrrryyyy command,  with  no  arguments,  will  print  all  the
  1587.            commands that are currently saved in the shell's history buffers.
  1588.            As new commands are executed, and space in the buffers runs  out,
  1589.            old  commands  will  be deleted.  The hhhhiiiissssttttoooorrrryyyy commands prints out
  1590.            the stored commands with  sequence  numbers.   Negative  numbered
  1591.            commands,  through  command  number  zero, are commands that were
  1592.            retrieved from the saved history file.  Commands starting at  one
  1593.            were  entered  during  the  current  login  session.   If a saved
  1594.            command contains embedded newlines, these will be printed out  as
  1595.            the sequence \\\\nnnn, so that individual command stay on one line.
  1596.  
  1597.            The  arguments  changes  the  way  the  shell  processes  history
  1598.            information as follows:
  1599.  
  1600.            ----dddd   Disable the saving of commands in the history file.
  1601.  
  1602.            ----eeee   Enable the saving of commands in the history file.
  1603.  
  1604.            ----iiii   Initialise the history file.
  1605.  
  1606.            ----llll   Load the  history  from  the  file  given  by  the  HHHHIIIISSSSTTTTFFFFIIIILLLLEEEE
  1607.                 environment variable.
  1608.  
  1609.  
  1610.  
  1611.  
  1612.                                    - 26 -         Formatted:  April 14, 1992
  1613.  
  1614.  
  1615.  
  1616.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1617.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1618.  
  1619.  
  1620.  
  1621.            ----ssss    Save  the  history  to  the  file  given  by  the  HHHHIIIISSSSTTTTFFFFIIIILLLLEEEE
  1622.                 environment variable.
  1623.  
  1624.       jjjjoooobbbbssss [ ----llll ]
  1625.            This command (which is  only  available  under  OS/2)  lists  the
  1626.            active jobs; giving the -l options lists process id's in addition
  1627.            to the normal information.
  1628.  
  1629.       kkkkiiiillllllll [ ----ssssiiiigggg ] process ...
  1630.            This command (which is only available under  OS/2)  sends  either
  1631.            the  TTTTEEEERRRRMMMM  (terminate)  signal  or  the  specified  signal to the
  1632.            specified _p_r_o_c_e_s_s_e_s.  _S_i_g_n_a_l_s _a_r_e _g_i_v_e_n _b_y _n_a_m_e, _w_h_i_c_h _a_r_e _l_i_s_t_e_d
  1633.            _b_y ''''kkkkiiiillllllll ----llll''''.
  1634.  
  1635.       lllleeeetttt [ _a_r_g ... ]
  1636.            Each _a_r_g is  an  arithmetic  expression  to  be  evaluated.   All
  1637.            calculations  are done as long integers and no check for overflow
  1638.            is performed. See AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEEvvvvaaaalllluuuuaaaattttiiiioooonnnn above for  a  description
  1639.            of arithmetic expressions..
  1640.  
  1641.            The return code is 0 if the value of the last expression is  non-
  1642.            zero, and 1 otherwise.
  1643.  
  1644.       mmmmssssddddoooossss [ _n_a_m_e[=_v_a_l_u_e] ... ]
  1645.            The given _n_a_m_es are marked _m_s_d_o_s format and if  the  ----mmmm  flag  is
  1646.            set,  the  values  of  the  these  _n_a_m_es  are  exported  to child
  1647.            processes with any slashes in the value replaced by  \\\\s.   If  no
  1648.            arguments are given, a list of all _m_s_d_o_s names is printed.
  1649.  
  1650.       pppprrrriiiinnnntttt [ ----RRRRnnnnpppprrrrssss ] [ ----uuuu uuuunnnniiiitttt ] [ _a_r_g_s ... ]
  1651.            The shell output mechanism.  With no flags or with flag -  or  --
  1652.            the  _a_r_g_s are printed on standard output as described by the eeeecccchhhhoooo
  1653.            command.
  1654.  
  1655.            ----RRRR   Prints in the raw mode, in which the escape  conventions  of
  1656.                 the  eeeecccchhhhoooo  command  are  ignored.   The -_R option prints all
  1657.                 subsequent _a_r_g_s and options other than -_n.
  1658.  
  1659.            ----nnnn   Prevents a new-line from being added to the output.
  1660.  
  1661.            ----pppp   ----pppp flag has not effect and is defined for compatability.
  1662.  
  1663.            ----rrrr   Prints in the raw mode, in which the escape  conventions  of
  1664.                 the eeeecccchhhhoooo command are ignored.
  1665.  
  1666.            ----ssss   Writes the _a_r_g_s to the history file instead of  to  standard
  1667.                 output.
  1668.  
  1669.            ----uuuu uuuunnnniiiitttt
  1670.                 Specifies a one digit file descriptor uuuunnnniiiitttt number  on  which
  1671.                 the output is placed.  The default is 1.
  1672.  
  1673.  
  1674.                                    - 27 -         Formatted:  April 14, 1992
  1675.  
  1676.  
  1677.  
  1678.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1679.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1680.  
  1681.  
  1682.  
  1683.       ppppwwwwdddd [ _d_r_i_v_e ... ]
  1684.            Print the current working directory.  If _d_r_i_v_e  is  present,  the
  1685.            current  working  directory  on  each  of  the drives is printed.
  1686.            _d_r_i_v_e contains a string of drive letters, no colons are required.
  1687.  
  1688.       rrrreeeeaaaadddd [ ----pppprrrrssss ] [ ----uuuu uuuunnnniiiitttt ] [ _n_a_m_e?_p_r_o_m_p_t ] [ _n_a_m_e ... ]
  1689.            The shell input mechanism.  One line is read  and  is  broken  up
  1690.            into  words  using  the  characters in IIIIFFFFSSSS as separators.  In raw
  1691.            mode, ----rrrr, a \\\\ at  the  end  of  a  line  does  not  signify  line
  1692.            continuation.   The first word is assigned to the first _n_a_m_e, the
  1693.            second word  to  the  second  _n_a_m_e,  etc.,  with  leftover  words
  1694.            assigned  to the last _n_a_m_e.  If the ----ssss flag is present, the input
  1695.            will be saved as a command in the history file.  The ----pppp flag  has
  1696.            not  effect and is defined for compatability.  The flag ----uuuu can be
  1697.            used to specify a one digit file descriptor uuuunnnniiiitttt  to  read  from.
  1698.            The  file descriptor can be opened with the eeeexxxxeeeecccc special command.
  1699.            The default value of uuuunnnniiiitttt is 0.  If _n_a_m_e is omitted then RRRREEEEPPPPLLLLYYYY is
  1700.            used  as  the  default name.  If the first argument contains a ????,
  1701.            the remainder of this word is used as a prompt when the shell  is
  1702.            interactive.   If  the  given file descriptor is open for writing
  1703.            and is a terminal device then the prompt is placed on this  unit.
  1704.            Otherwise  the prompt is issued on file descriptor 2.  The return
  1705.            code is 0 unless an end-of-file is encountered.
  1706.  
  1707.       rrrreeeeaaaaddddoooonnnnllllyyyy [ _n_a_m_e[=_v_a_l_u_e] ... ]
  1708.            The given _n_a_m_es are marked _r_e_a_d_o_n_l_y and the values of  the  these
  1709.            _n_a_m_es  may  not  be  changed  by  subsequent  assignment.   If no
  1710.            arguments are given, a list of all _r_e_a_d_o_n_l_y names is printed.
  1711.  
  1712.       rrrreeeettttuuuurrrrnnnn [ _n ]
  1713.            Causes a function to exit with the return value specified  by  _n.
  1714.            If  _n  is  omitted, the return status is that of the last command
  1715.            executed.
  1716.  
  1717.       sssseeeetttt [ [----||||++++]aaaaeeeeffffkkkkmmmmnnnnttttuuuuvvvvxxxx ] [ ----oooo ooooppppttttiiiioooonnnn ] [ _a_r_g ... ]
  1718.  
  1719.            ----aaaa   Mark variables which are modified or created for export.
  1720.  
  1721.            ----eeee   Exit immediately if a command exits  with  a  non-zero  exit
  1722.                 status.
  1723.  
  1724.            ----ffff   Disable file name generation
  1725.  
  1726.            ----kkkk   All keyword arguments are placed in the  environment  for  a
  1727.                 command, not just those that precede the command name.
  1728.  
  1729.            ----mmmm   For those variables marked as mmmmssssddddoooossss  variables,  the  values
  1730.                 are exported to child processes with the slashes replaced by
  1731.                 \\\\s.  Most MSDOS  utilities  do  not  care  if  a  file  name
  1732.                 contains  a  slash  or \\\\ as a directory separator.  However,
  1733.                 some like the _l_i_n_k_e_r require \\\\s in  the  value  of  the  LLLLIIIIBBBB
  1734.  
  1735.  
  1736.                                    - 28 -         Formatted:  April 14, 1992
  1737.  
  1738.  
  1739.  
  1740.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1741.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1742.  
  1743.  
  1744.  
  1745.                 variable.
  1746.  
  1747.            ----nnnn   Read commands but do not execute them.
  1748.  
  1749.            ----oooo ooooppppttttiiiioooonnnn
  1750.                 The argument that follows this option  can  be  one  of  the
  1751.                 following option names:
  1752.  
  1753.                 aaaalllllllleeeexxxxppppoooorrrrtttt
  1754.                      Same as ----aaaa....
  1755.  
  1756.                 bbbbeeeellllllll Enable alarm bell on errors
  1757.  
  1758.                 eeeerrrrrrrreeeexxxxiiiitttt
  1759.                      Same as ----eeee....
  1760.  
  1761.                 hhhhaaaallllffffhhhheeeeiiiigggghhhhtttt
  1762.                      Set cursor to halfheight when in insert mode.  If  off,
  1763.                      a full height cursor is used.
  1764.  
  1765.                 iiiiggggnnnnoooorrrreeeeeeeeooooffff
  1766.                      The shell will not exit on  end-of-file.   The  command
  1767.                      exit must be used.
  1768.  
  1769.                 iiiinnnnsssseeeerrrrttttmmmmooooddddeeee
  1770.                      Set  the  default  edit  mode  to  insert  rather  than
  1771.                      overwrite.
  1772.  
  1773.                 kkkkeeeeyyyywwwwoooorrrrdddd
  1774.                      Same as ----kkkk....
  1775.  
  1776.                 mmmmaaaarrrrkkkkddddiiiirrrrssss
  1777.                      Appends a / (slash) to all directory names that  are  a
  1778.                      result of file name substitution.
  1779.  
  1780.                 nnnnoooocccclllloooobbbbbbbbeeeerrrr
  1781.                      Prevents redirection >>>> from truncating existing  files.
  1782.                      A  vertical bar must follow the redirection symbol ((((>>>>||||))))
  1783.                      to truncate a file when this option is turned on.
  1784.  
  1785.                 nnnnooooeeeexxxxeeeecccc
  1786.                      Same as ----nnnn....
  1787.  
  1788.                 nnnnoooogggglllloooobbbb
  1789.                      Same as ----ffff....
  1790.  
  1791.                 nnnnoooouuuunnnnsssseeeetttt
  1792.                      Same as ----uuuu....
  1793.  
  1794.                 pppprrrriiiivvvviiiilllleeeeggggeeeedddd
  1795.                      Same as ----pppp....
  1796.  
  1797.  
  1798.                                    - 29 -         Formatted:  April 14, 1992
  1799.  
  1800.  
  1801.  
  1802.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1803.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1804.  
  1805.  
  1806.  
  1807.                 ttttrrrraaaacccckkkkaaaallllllll
  1808.                      Same as ----hhhh....
  1809.  
  1810.                 vvvveeeerrrrbbbboooosssseeee
  1811.                      Same as ----vvvv....
  1812.  
  1813.                 xxxxttttrrrraaaacccceeee
  1814.                      Same as ----xxxx....
  1815.  
  1816.            ----tttt   Exit after reading and executing one command.
  1817.  
  1818.            ----uuuu   Treat unset variables as an error when substituting.
  1819.  
  1820.            ----vvvv   Print shell input lines as they are read.
  1821.  
  1822.            ----xxxx   Print commands and their arguments as they are executed.
  1823.  
  1824.            --------   Do not change any of the flags; useful in setting $$$$1111 to ----.
  1825.  
  1826.                 Using ++++ rather than ---- causes these flags to be  turned  off.
  1827.                 These  flags  can also be used upon invocation of the shell.
  1828.                 The current set of flags may be found in $$$$----.  The  remaining
  1829.                 arguments  are  positional  parameters  and are assigned, in
  1830.                 order, to $$$$1111, $$$$2222, ....  If no arguments are given the values
  1831.                 of all names are printed.
  1832.  
  1833.       sssshhhhiiiifffftttt [ _n ]
  1834.            The positional parameters from $$$$nnnn++++1111 ...  are renamed $$$$1111 ....   If
  1835.            _n is not given, it is assumed to be 1.
  1836.  
  1837.       ssssttttaaaarrrrtttt [ ----ddddffffiiiiCCCCWWWWPPPPFFFF ] [ ----tttt ttttiiiittttlllleeee ] [ _p_r_o_g_r_a_m [ _a_r_g_u_m_e_n_t_s.. ] ]
  1838.            This command (which is only available under OS/2) starts an  OS/2
  1839.            _p_r_o_g_r_a_m in a new session.  If no _p_r_o_g_r_a_m and _a_r_g_u_m_e_n_t_s parameters
  1840.            are entered, the shell is started unless the -C option  has  been
  1841.            used to select the OS/2 command processor.
  1842.  
  1843.            The arguments changes the way the shell  starts  the  session  as
  1844.            follows:
  1845.  
  1846.            ----dddd   Normally, command are started by invoking the shell  in  the
  1847.                 new session.  This option invokes the command directly.
  1848.  
  1849.            ----ffff    The  program  becomes  the  foreground  session.  If   this
  1850.                 parameter is not specified, the program becomes a background
  1851.                 session.
  1852.  
  1853.            ----iiii   The new session will inherit the original environment of the
  1854.                 shell instead of the current environment.
  1855.  
  1856.            ----tttt ttttiiiittttlllleeee
  1857.                 Sets the _t_i_t_l_e of the new session.
  1858.  
  1859.  
  1860.                                    - 30 -         Formatted:  April 14, 1992
  1861.  
  1862.  
  1863.  
  1864.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1865.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1866.  
  1867.  
  1868.  
  1869.            ----FFFF   This application is a full-screen application that must  run
  1870.                 in a separate session independent of Presentation Manager.
  1871.  
  1872.            ----WWWW   This is an OS/2 application that runs within a  Presentation
  1873.                 Manager window.
  1874.  
  1875.            ----PPPP   This  application  is  started  as  a  Presentation  Manager
  1876.                 application.
  1877.  
  1878.            ----CCCC   Use the OS/2 command processor instead of the shell.
  1879.  
  1880.       sssswwwwaaaapppp [ _o_p_t_i_o_n_s ]
  1881.            This command (which is only available under MS-DOS)  defines  how
  1882.            the  shell  will  handle  swapping  itself  to  reduce its memory
  1883.            requirements whilst other programs execute.  The options are
  1884.  
  1885.            ooooffffffff  Disable swapping.  The shell remains in  memory  whilst  the
  1886.                 child  is  running and reduces the available memory by about
  1887.                 200K (depending on the size of the environment and history).
  1888.  
  1889.            oooonnnn   Enable all devices.  The  shell  will  swap  out  to  either
  1890.                 expanded  or extended memory or to disk, execute the command
  1891.                 and then swap back in.  Whilest swapped, the  shell  reduces
  1892.                 the available memory by about 3K.
  1893.  
  1894.            eeeexxxxppppaaaannnndddd
  1895.                 Enable swapping to Expanded Memory.   The  EMS  driver  must
  1896.                 exist on your system for this to work.
  1897.  
  1898.            eeeexxxxtttteeeennnndddd [ _s_t_a_r_t _a_d_d_r_e_s_s ]
  1899.                 Enable swapping to Extended Memory.   If  you  have  an  XMS
  1900.                 driver  on  your  system, the shell will use the XMS driver.
  1901.                 Otherwise, the BIOS Interrupt 15  interface  is  used.   The
  1902.                 optional  start  address  defines  the  based address in the
  1903.                 Extended Memory at which point the  shell  writes  its  swap
  1904.                 area  when the BIOS interface is used.  The default location
  1905.                 is _0_x_1_0_0_0_0_0.
  1906.  
  1907.            ddddiiiisssskkkk Enable swapping to disk.  The shell creates a temporary file
  1908.                 and saves itself in it.  On completion, the file is deleted.
  1909.                 This is the slowest method of swapping.
  1910.  
  1911.                 With no options, the current swapping options are displayed.
  1912.  
  1913.       tttteeeesssstttt _e_x_p_r or [[[[ _e_x_p_r ]]]]
  1914.            Evaluate conditional expressions.  TTTTeeeesssstttt evaluates the  expression
  1915.            _e_x_p_r  and,  if  its  value  is  true,  returns a zero (true) exit
  1916.            status; otherwise, a non-zero (false) exit  status  is  returned;
  1917.            tttteeeesssstttt  also  returns  a  non-zero  exit  status  if  there  are no
  1918.            arguments.  The primitives are the same as for the [[[[[[[[  _e_x_p_r_e_s_s_i_o_n
  1919.            ]]]]]]]]  command,  except  that  -_a and -_o are not primitives, but are
  1920.  
  1921.  
  1922.                                    - 31 -         Formatted:  April 14, 1992
  1923.  
  1924.  
  1925.  
  1926.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1927.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1928.  
  1929.  
  1930.  
  1931.            used to combine operators (see tttteeeesssstttt ((((1111))))).  -_a is the  binary  aaaannnndddd
  1932.            operator and -_o is the binary oooorrrr operator.
  1933.  
  1934.            Notice that all the operators and flags are separate arguments to
  1935.            tttteeeesssstttt.   Notice  also that parentheses are meaningful to the shell
  1936.            and, therefore, must be escaped.
  1937.  
  1938.       ttttrrrraaaapppp [ _a_r_g ] [ _S_i_g_n_a_l_N_u_m_b_e_r ] ...
  1939.            The command _a_r_g is  to  be  read  and  executed  when  the  shell
  1940.            receives  signal(s) _S_i_g_n_a_l_N_u_m_b_e_r.  (Note that _a_r_g is scanned once
  1941.            when the trap is set and once when  the  trap  is  taken.)   Trap
  1942.            commands  are executed in order of signal number.  Any attempt to
  1943.            set a trap on a signal that was ignored on entry to  the  current
  1944.            shell  is ineffective.  If _a_r_g is absent all trap(s) _S_i_g_n_a_l_N_u_m_b_e_r
  1945.            are reset to their original values.  If _a_r_g is  the  null  string
  1946.            this  signal  is  ignored  by  the  shell  and by the commands it
  1947.            invokes.  If _S_i_g_n_a_l_N_u_m_b_e_r is DDDDEEEEBBBBUUUUGGGG  then  _a_r_g  will  be  executed
  1948.            after each command.  If _S_i_g_n_a_l_N_u_m_b_e_r is EEEERRRRRRRR, _a_r_g will be executed
  1949.            whenever a command has a non-zero exit code.  If _S_i_g_n_a_l_N_u_m_b_e_r  is
  1950.            0 or EEEEXXXXIIIITTTT and the trap statement is executed inside the body of a
  1951.            function,  the  command  _a_r_g  is  executed  after  the   function
  1952.            completes.   If  _S_i_g_n_a_l_N_u_m_b_e_r is 0 or EEEEXXXXIIIITTTT for a trap set outside
  1953.            any function, the command _a_r_g is executed on exit from the shell.
  1954.            The  ttttrrrraaaapppp  command  with  no  arguments prints a list of commands
  1955.            associated with each signal number.
  1956.  
  1957.       ttttrrrruuuueeee No effect; the  command  does  nothing.   A  zero  exit  code  is
  1958.            returned.
  1959.  
  1960.       ttttyyyyppppeeeesssseeeetttt [ ----HHHHLLLLRRRRZZZZffffiiiillllpppprrrrttttuuuuxxxx[nnnn] [ nnnnaaaammmmeeee[ ====vvvvaaaalllluuuueeee ] ] ... ]
  1961.            When invoked inside a function, a new instance of  the  parameter
  1962.            name  is created.  The parameter value and type are restored when
  1963.            the function completes.  The following list of attributes may  be
  1964.            specified:
  1965.  
  1966.            ----HHHH   This flag provides UNIX to host-name file  mapping  on  non-
  1967.                 UNIX machines (see mmmmssssddddoooossss command).
  1968.  
  1969.            ----LLLL   Left justify and remove leading blanks from value.  If nnnn  is
  1970.                 non-zero  it defines the width of the field, otherwise it is
  1971.                 determined by the width of the value  of  first  assignment.
  1972.                 When the parameter is assigned to, it is filled on the right
  1973.                 with blanks or truncated, if  necessary,  to  fit  into  the
  1974.                 field.   Leading  zeros  are  removed if the ----ZZZZ flag is also
  1975.                 set.  The ----RRRR flag is turned off.
  1976.  
  1977.            ----RRRR   Right justify and fill with leading blanks.  If  nnnn  is  non-
  1978.                 zero,  it  defines  the  width of the field, otherwise it is
  1979.                 determined by the width of the value  of  first  assignment.
  1980.                 The  field  is left filled with blanks or truncated from the
  1981.                 end if the parameter is reassigned.  The ----LLLL flag  is  turned
  1982.  
  1983.  
  1984.                                    - 32 -         Formatted:  April 14, 1992
  1985.  
  1986.  
  1987.  
  1988.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  1989.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  1990.  
  1991.  
  1992.  
  1993.                 off.
  1994.  
  1995.            ----ZZZZ   Right justify and fill with leading zeros if the first  non-
  1996.                 blank character is a digit and the ----LLLL flag has not been set.
  1997.                 If nnnn is  non-zero,  it  defines  the  width  of  the  field,
  1998.                 otherwise  it  is  determined  by  the width of the value of
  1999.                 first assignment.
  2000.  
  2001.            ----ffff   The names refer to  function  names  rather  than  parameter
  2002.                 names.   No assignments can be made and the only other valid
  2003.                 flags are ----tttt, which turns  on  execution  tracing  for  this
  2004.                 function  and  ----xxxx, to allow the function to remain in effect
  2005.                 across  shell  procedures  executed  in  the  same   process
  2006.                 environment.
  2007.  
  2008.            ----iiii   Parameter is an integer.  This makes arithmetic faster.   If
  2009.                 nnnn  is  non-zero  it  defines  the  output  arithmetic  base,
  2010.                 otherwise the first assignment determines the output base.
  2011.  
  2012.            ----llll   All upper-case  characters  converted  to  lower-case.   The
  2013.                 upper-case flag, ----uuuu is turned off.
  2014.  
  2015.            ----pppp   The output of this command, if  any,  is  written  onto  the
  2016.                 two-way pipe.  TTTThhhhiiiissss ooooppppttttiiiioooonnnn hhhhaaaassss nnnnoooo eeeeffffffffeeeecccctttt iiiinnnn tttthhhheeee SSSShhhheeeellllllll.
  2017.  
  2018.            ----rrrr   The given names are marked readonly and these  names  cannot
  2019.                 be changed by subsequent assignment.
  2020.  
  2021.            ----tttt   Tags the named parameters. Tags are user definable and  have
  2022.                 no special meaning to the shell.
  2023.  
  2024.            ----uuuu    All  lower-case  characters  are  converted  to  upper-case
  2025.                 characters.  The lower-case flag, ----llll is turned off.
  2026.  
  2027.            ----xxxx   The given names are  marked  for  automatic  export  to  the
  2028.                 environment of subsequently-executed commands.
  2029.  
  2030.            Using + rather than - causes these flags to be turned off.  If no
  2031.            name arguments are given but flags are specified, a list of names
  2032.            (and optionally the values) of the parameters  which  have  these
  2033.            flags set is printed.  (Using + rather than - keeps the values to
  2034.            be printed.)  If no names and flags  are  given,  the  names  and
  2035.            attributes of all parameters are printed.
  2036.  
  2037.       uuuummmmaaaasssskkkk [ _n_n_n ]
  2038.            The user file-creation mask is set to _n_n_n (see _u_m_a_s_k(2)).  If _n_n_n
  2039.            is omitted, the current value of the mask is printed.
  2040.  
  2041.       uuuunnnnaaaalllliiiiaaaassss _n_a_m_e ...
  2042.            The aliases given by the list of _n_a_m_es are removed from the alias
  2043.            list.
  2044.  
  2045.  
  2046.                                    - 33 -         Formatted:  April 14, 1992
  2047.  
  2048.  
  2049.  
  2050.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  2051.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  2052.  
  2053.  
  2054.  
  2055.       uuuunnnnffffuuuunnnnccccttttiiiioooonnnn _n_a_m_e ...
  2056.            For each _n_a_m_e, remove the corresponding function.
  2057.  
  2058.       uuuunnnnsssseeeetttt [ ----ffff ] _n_a_m_e ...
  2059.            The parameters given by the list of _n_a_m_es are  unassigned  (their
  2060.            values  and  attributes are erased).  The following variables, as
  2061.            well as those with a read-only attribute cannot be  unset:  PPPPAAAATTTTHHHH,
  2062.            PPPPSSSS1111,  PPPPSSSS2222,  and IIIIFFFFSSSS.  If the -f flag is set, then the names refer
  2063.            to function names and the functions are removed.
  2064.  
  2065.       vvvveeeerrrr  Display the current version of the shell.
  2066.  
  2067.       wwwwhhhheeeennnncccceeee [ ----ppppvvvv ] [ _n_a_m_e ... ]
  2068.       ttttyyyyppppeeee [ ----pppp ] [ _n_a_m_e ... ]
  2069.            For each _n_a_m_e specified, indicate how it would be interpreted  if
  2070.            used as a command name.  Note that ttttyyyyppppeeee is a shorthand for wwwwhhhheeeennnncccceeee
  2071.            ----vvvv.
  2072.  
  2073.            ----pppp   Does a path search for _n_a_m_e even if the name is an alias,  a
  2074.                 function, or a reserved word.
  2075.  
  2076.            ----vvvv   Produces a more verbose report.
  2077.  
  2078.     IIIInnnnvvvvooooccccaaaattttiiiioooonnnn
  2079.       If the shell is invoked through _e_x_e_c(2) and  the  first  character  of
  2080.       argument  zero  is ---- or the ----0000(zero) switch is in the invokation line,
  2081.       commands  are   initially   read   from   ////eeeettttcccc////pppprrrrooooffffiiiilllleeee....sssshhhh   and   from
  2082.       $$$$HHHHOOOOMMMMEEEE////pppprrrrooooffffiiiilllleeee....sssshhhh,  if  such files exist.  Next, commands are read from
  2083.       the file named by performing parameter substitution on  the  value  of
  2084.       the  environment  parameter  EEEENNNNVVVV  if  the  file  exists.   Thereafter,
  2085.       commands are read as described below, which is also the case when  the
  2086.       shell  is  invoked as ////bbbbiiiinnnn////sssshhhh.  The flags below are interpreted by the
  2087.       shell on invocation only; Note that  unless  the  ----cccc  or  ----ssss  flag  is
  2088.       specified,  the  first  argument  is  assumed to be the name of a file
  2089.       containing  commands,  and  the  remaining  arguments  are  passed  as
  2090.       positional parameters to that command file:
  2091.  
  2092.       ----cccc string If the ----cccc flag is present commands are read from _s_t_r_i_n_g.
  2093.  
  2094.       ----ssss        If the ----ssss flag is present or if no arguments remain commands
  2095.                 are  read  from the standard input.  Any remaining arguments
  2096.                 specify the positional parameters.  Shell output (except for
  2097.                 _S_p_e_c_i_a_l _C_o_m_m_a_n_d_s) is written to file descriptor 2.
  2098.  
  2099.       ----iiii        If the ----iiii flag is present or if the shell input  and  output
  2100.                 are  attached  to a terminal, this shell is _i_n_t_e_r_a_c_t_i_v_e.  In
  2101.                 this case, the TERMINATE signal is ignored and the INTERRUPT
  2102.                 signal is caught and ignored.  In all cases, the QUIT signal
  2103.                 is ignored by the shell.
  2104.  
  2105.  
  2106.  
  2107.  
  2108.                                    - 34 -         Formatted:  April 14, 1992
  2109.  
  2110.  
  2111.  
  2112.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  2113.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  2114.  
  2115.  
  2116.  
  2117.       ----rrrr        If the ----rrrr flag is present, the shell is a restricted shell.
  2118.  
  2119.       ----0000(zero)  If the ----0000(zero) flag is present, this has the same effect as
  2120.                 starting the shell with the first character of argument zero
  2121.                 as a ---- (see above).
  2122.  
  2123.       ----RRRR        If the ----RRRR flag is present, the shell is the _r_o_o_t  shell  and
  2124.                 cannot  be  terminated  using exit.  Under MSDOS, the system
  2125.                 must be re-booted.  Under OS/2, the shell must be killed  by
  2126.                 an external program.
  2127.  
  2128.       The remaining flags and arguments are described under the sssseeeetttt  command
  2129.       above.
  2130.  
  2131.     RRRRsssshhhh OOOOnnnnllllyyyy
  2132.       _R_s_h is used to set up login names  and  execution  environments  whose
  2133.       capabilities  are  more  controlled  than those of the standard shell.
  2134.       The actions of _r_s_h are identical to  those  of  _s_h,  except  that  the
  2135.       following are disallowed:
  2136.  
  2137.            Changing directory (see _c_d(1)),
  2138.            Setting the value of SSSSHHHHEEEELLLLLLLL, EEEENNNNVVVV, or $$$$PPPPAAAATTTTHHHH,
  2139.            Specifying path or command names containing ////,
  2140.            Redirecting output (>>>> and >>>>>>>>).
  2141.  
  2142.       The restrictions above are enforced after pppprrrrooooffffiiiilllleeee....sssshhhh and the EEEENNNNVVVV files
  2143.       are interpreted.
  2144.  
  2145.       When a command to be executed is found to be a  shell  procedure,  _r_s_h
  2146.       invokes  _s_h  to  execute  it.   Thus, it is possible to provide to the
  2147.       end-user shell procedures that have access to the full  power  of  the
  2148.       standard shell, while imposing a limited menu of commands; this scheme
  2149.       assumes that the end-user does not have write and execute  permissions
  2150.       in the same directory.
  2151.  
  2152.       The net effect of these rules is that the writer of the pppprrrrooooffffiiiilllleeee....sssshhhh has
  2153.       complete  control  over  user  actions, by performing guaranteed setup
  2154.       actions and leaving the user in an appropriate directory (probably _n_o_t
  2155.       the login directory).
  2156.  
  2157.       The system administrator often sets up a directory of commands  (i.e.,
  2158.       ////uuuussssrrrr////rrrrbbbbiiiinnnn)  that  can  be  safely  invoked  by _r_s_h.  Some systems also
  2159.       provide a restricted editor _r_e_d.
  2160.  
  2161.  EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS
  2162.       Errors detected by the shell, such as syntax errors, cause  the  shell
  2163.       to  return  a  non-zero  exit status.  If the shell is being used non-
  2164.       interactively execution of the shell file  is  abandoned.   Otherwise,
  2165.       the  shell  returns  the exit status of the last command executed (see
  2166.       also the eeeexxxxiiiitttt command above).
  2167.  
  2168.  
  2169.  
  2170.                                    - 35 -         Formatted:  April 14, 1992
  2171.  
  2172.  
  2173.  
  2174.  SSSSHHHH((((1111LLLL))))                   MMMMSSSS----DDDDOOOOSSSS ---- OOOOSSSS////2222 VVVVeeeerrrrssssiiiioooonnnn 2222....0000                   SSSSHHHH((((1111LLLL))))
  2175.                              DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd
  2176.  
  2177.  
  2178.  
  2179.  FFFFIIIILLLLEEEESSSS
  2180.       /etc/profile.sh
  2181.       $HOME/profile.sh
  2182.       $HOME/history.sh.
  2183.       $TMP/sh*.tmp
  2184.       ??/sh.ini
  2185.  
  2186.  CCCCRRRRIIIITTTTIIIICCCCAAAALLLL EEEERRRRRRRROOOORRRRSSSS
  2187.       The Shell provide a Critical Error Handler (Interrupt 24)  similar  to
  2188.       the  standard MSDOS handler.  In addition to the standard message, the
  2189.       handler  also  displays  the  Extended  Error  Code   information   in
  2190.       hexadecimal.
  2191.  
  2192.  LLLLIIIIMMMMIIIIIIIITTTTAAAATTTTIIIIOOOONNNNSSSS
  2193.       Under MS-DOS, any TSR  (Terminate  Stay  Resident)  programs  must  be
  2194.       loaded  before  loading _S_h as the shell will overwrite the TSR when it
  2195.       reloads itself after swapping out.
  2196.  
  2197.       Under OS/2, asynchronous commands are supported to a degree.  However,
  2198.       this  is  very  limited  because of the nature of the forking commands
  2199.       under OS/2 which does not match the UNIX model.  This  difference  has
  2200.       also  meant that pipes (as in MS-DOS) are implemented as files and not
  2201.       OS/2 pipes.  For more details, see the source code.
  2202.  
  2203.  SSSSEEEEEEEE AAAALLLLSSSSOOOO
  2204.       cd(1), env(1), test(1), umask(1).
  2205.       dup(2), exec(2), pipe(2),  signal(2),  umask(2),  wait(2),  strtol(3),
  2206.       profile(4), environ(5) in the _U_N_I_X _S_y_s_t_e_m _P_r_o_g_r_a_m_m_e_r _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  2207.  
  2208.  AAAACCCCKKKKNNNNOOOOWWWWLLLLEEEEDDDDGGGGEEEEMMMMEEEENNNNTTTTSSSS
  2209.       This program is based on ideas, code or parts of code developed by:
  2210.  
  2211.       David Korn and Steve Bourne (the original ideas)
  2212.       Charles Forsyth (the original source for the MINIX Shell program)
  2213.       Erik Baalbergen (the code for the test function)
  2214.       Paul Falstad (the code for the maths functions)
  2215.  
  2216.       In addition, a very large number of people (too many to  mention)  who
  2217.       have been involved in testing and debugging the program.
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.                                    - 36 -         Formatted:  April 14, 1992
  2233.  
  2234.