home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / GNU / SH164AX.ZIP / SH.MAN < prev   
Encoding:
Text File  |  1990-11-06  |  83.0 KB  |  1,585 lines

  1.  
  2.  
  3.  
  4.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           sh, rsh - shell, the standard/restricted command programming
  10.           language
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           sssshhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnmmmmrrrrssssttttuuuuvvvvxxxx0000 ] [ args ]
  14.           rrrrsssshhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnmmmmrrrrssssttttuuuuvvvvxxxx0000 ] [ args ]
  15.  
  16.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.           _S_h is a command programming language that executes commands
  18.           read from a terminal or a file.  _R_s_h is a restricted version
  19.           of the standard command interpreter _s_h; it is used to set up
  20.           login names and execution environments whose capabilities
  21.           are more controlled than those of the standard shell.  See
  22.           _I_n_v_o_c_a_t_i_o_n below for the meaning of arguments to 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
  26.           letters, digits, or underscores beginning with a letter or
  27.           underscore.  A _p_a_r_a_m_e_t_e_r is a name, a digit, or any of the
  28.           characters ****, @@@@, ####, ????, ----, $$$$, and !!!!.
  29.  
  30.         CCCCoooommmmmmmmaaaannnnddddssss
  31.           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
  32.           by _b_l_a_n_k_s.  The first word specifies the name of the command
  33.           to be executed.  Except as specified below, the remaining
  34.           words are passed as arguments to the invoked command.  The
  35.           command name is passed as argument 0 (see _e_x_e_c(2)).  The
  36.           _v_a_l_u_e of a simple-command is its exit status if it
  37.           terminates normally, or (octal) 200+_s_t_a_t_u_s if it terminates
  38.           abnormally (see _s_i_g_n_a_l(2) for a list of status values).
  39.  
  40.           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
  41.           by |||| (or, for historical compatibility, by ^^^^).  The standard
  42.           output of each command but the last is connected by a
  43.           _p_i_p_e(2) to the standard input of the next command.  Each
  44.           command is run as a separate process; the shell waits for
  45.           the last command to terminate.  The exit status of a
  46.           pipeline is the exit status of the last command.
  47.  
  48.           A _l_i_s_t is a sequence of one or more pipelines separated by
  49.           ;;;;, &&&&&&&&, or ||||||||, and optionally terminated by ;;;;.  Of these
  50.           three symbols, ;;;; has a lower precedence than that of &&&&&&&& and
  51.           ||||||||.  The symbols &&&&&&&& and |||||||| also have equal precedence.  A
  52.           semicolon (;;;;) causes sequential execution of the preceding
  53.           pipeline.  The symbol &&&&&&&& (||||||||) causes the _l_i_s_t following it
  54.           to be executed only if the preceding pipeline returns a zero
  55.           (non-zero) exit status.  An arbitrary number of new-lines
  56.           may appear in a _l_i_s_t, instead of semicolons, to delimit
  57.           commands.
  58.  
  59.           A _c_o_m_m_a_n_d is either a simple-command or one of the
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 11/6/90)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  71.  
  72.  
  73.  
  74.           following.  Unless otherwise stated, the value returned by a
  75.           command is that of the last simple-command executed in the
  76.           command.
  77.  
  78.           ffffoooorrrr _n_a_m_e [ iiiinnnn _w_o_r_d ... ] ddddoooo _l_i_s_t ddddoooonnnneeee
  79.                Each time a ffffoooorrrr command is executed, _n_a_m_e is set to the
  80.                next _w_o_r_d taken from the iiiinnnn _w_o_r_d list.  If iiiinnnn _w_o_r_d ...
  81.                is omitted, then the ffffoooorrrr command executes the ddddoooo _l_i_s_t
  82.                once for each positional parameter that is set (see
  83.                _P_a_r_a_m_e_t_e_r _S_u_b_s_t_i_t_u_t_i_o_n below).  Execution ends when
  84.                there are no more words in the list.
  85.           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
  86.                A ccccaaaasssseeee command executes the _l_i_s_t associated with the
  87.                first _p_a_t_t_e_r_n that matches _w_o_r_d.  The form of the
  88.                patterns is the same as that used for file-name
  89.                generation (see _F_i_l_e _N_a_m_e _G_e_n_e_r_a_t_i_o_n) except that a
  90.                slash, a leading dot, or a dot immediately following a
  91.                slash need not be matched explicitly, and the match is
  92.                case sensitive.
  93.           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
  94.                The _l_i_s_t following iiiiffff is executed and, if it returns a
  95.                zero exit status, the _l_i_s_t following the first tttthhhheeeennnn is
  96.                executed.  Otherwise, the _l_i_s_t following eeeelllliiiiffff is
  97.                executed and, if its value is zero, the _l_i_s_t following
  98.                the next tttthhhheeeennnn is executed.  Failing that, the eeeellllsssseeee _l_i_s_t
  99.                is executed.  If no eeeellllsssseeee _l_i_s_t or tttthhhheeeennnn _l_i_s_t is executed,
  100.                then the iiiiffff command returns a zero exit status.
  101.           wwwwhhhhiiiilllleeee _l_i_s_t ddddoooo _l_i_s_t ddddoooonnnneeee
  102.                A wwwwhhhhiiiilllleeee command repeatedly executes the wwwwhhhhiiiilllleeee _l_i_s_t and,
  103.                if the exit status of the last command in the list is
  104.                zero, executes the ddddoooo _l_i_s_t; otherwise the loop
  105.                terminates.  If no commands in the ddddoooo _l_i_s_t are
  106.                executed, then the wwwwhhhhiiiilllleeee command returns a zero exit
  107.                status; uuuunnnnttttiiiillll may be used in place of wwwwhhhhiiiilllleeee to negate
  108.                the loop termination test.
  109.           ((((_l_i_s_t))))
  110.                Execute _l_i_s_t in a sub-shell.  The shell creates a new
  111.                environment in which to execute the _l_i_s_t, but does not
  112.                fork a sub-shell as a Unix system would.  The original
  113.                environment is restored on completion.
  114.           {{{{ _l_i_s_t;;;; }}}}
  115.                _l_i_s_t is simply executed.
  116.           _n_a_m_e (((()))) {{{{ _l_i_s_t;;;; }}}}
  117.                Define a function which is referenced by _n_a_m_e.  The
  118.                body of the function is the _l_i_s_t of commands between {{{{
  119.                and }}}}.  Execution of functions is described below (see
  120.                _E_x_e_c_u_t_i_o_n).
  121.  
  122.           The following words are only recognized as the first word of
  123.           a command and when not quoted:
  124.  
  125.           iiiiffff tttthhhheeeennnn eeeellllsssseeee eeeelllliiiiffff ffffiiii ccccaaaasssseeee eeeessssaaaacccc ffffoooorrrr wwwwhhhhiiiilllleeee uuuunnnnttttiiiillll ddddoooo ddddoooonnnneeee {{{{ }}}}
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 11/6/90)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  137.  
  138.  
  139.  
  140.         CCCCoooommmmmmmmeeeennnnttttssss
  141.           A word beginning with #### causes that word and all the
  142.           following characters up to a new-line to be ignored.
  143.  
  144.         TTTTiiiillllddddeeee SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  145.           Each word is checked to see if it begins with an unquoted~~~~.
  146.           If it is, the ~~~~ is replaced by the value of the HHHHOOOOMMMMEEEE
  147.           parameter.
  148.  
  149.         CCCCoooommmmmmmmaaaannnndddd SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  150.           The standard output from a command enclosed in parenthesis
  151.           preceded by a dollar sign ($$$$(((())))), or in a pair of grave
  152.           accents (````````) may be used as part or all of a word; trailing
  153.           new-lines are removed.
  154.  
  155.         PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
  156.           The character $$$$ is used to introduce substitutable
  157.           _p_a_r_a_m_e_t_e_r_s.  There are two types of parameters, positional
  158.           and keyword.  If _p_a_r_a_m_e_t_e_r is a digit, it is a positional
  159.           parameter.  Positional parameters may be assigned values by
  160.           sssseeeetttt.  Keyword parameters (also known as variables) may be
  161.           assigned values by writing:
  162.  
  163.                _n_a_m_e = _v_a_l_u_e [ _n_a_m_e = _v_a_l_u_e ] ...
  164.  
  165.           Pattern-matching is not performed on _v_a_l_u_e.  There cannot be
  166.           a function and a variable with the same _n_a_m_e.
  167.  
  168.           $$$${{{{_p_a_r_a_m_e_t_e_r}}}}
  169.                The value, if any, of the _p_a_r_a_m_e_t_e_r is substituted.
  170.                The braces are required only when _p_a_r_a_m_e_t_e_r is followed
  171.                by a letter, digit, or underscore that is not to be
  172.                interpreted as part of its name.  If _p_a_r_a_m_e_t_e_r is **** or
  173.                @@@@, all the positional parameters, starting with $$$$1111, are
  174.                substituted (separated by spaces).  Parameter $$$$0000 is set
  175.                from argument zero when the shell is invoked.
  176.           $$$${{{{####_p_a_r_a_m_e_t_e_r}}}}
  177.                If _p_a_r_a_m_e_t_e_r is **** or @@@@, the number of positional
  178.                parameters is substituted.  Otherwise, the length of
  179.                the value of the _p_a_r_a_m_e_t_e_r is substituted.
  180.           $$$${{{{_p_a_r_a_m_e_t_e_r::::----_w_o_r_d}}}}
  181.                If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
  182.                value; otherwise substitute _w_o_r_d.
  183.           $$$${{{{_p_a_r_a_m_e_t_e_r::::====_w_o_r_d}}}}
  184.                If _p_a_r_a_m_e_t_e_r is not set or is null set it to _w_o_r_d; the
  185.                value of the parameter is substituted.  Positional
  186.                parameters may not be assigned to in this way.
  187.           $$$${{{{_p_a_r_a_m_e_t_e_r::::????_w_o_r_d}}}}
  188.                If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
  189.                value; otherwise, print _w_o_r_d and exit from the shell.
  190.                If _w_o_r_d is omitted, the message ``parameter null or not
  191.                set'' is printed.
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 11/6/90)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  203.  
  204.  
  205.  
  206.           $$$${{{{_p_a_r_a_m_e_t_e_r::::++++_w_o_r_d}}}}
  207.                If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute _w_o_r_d;
  208.                otherwise substitute nothing.
  209.           $$$${{{{_p_a_r_a_m_e_t_e_r####_p_a_t_t_e_r_n}}}}
  210.                $$$${{{{_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
  211.                beginning of the value of _p_a_r_a_m_e_t_e_r, then the value of
  212.                this substitution is the value of the _p_a_r_a_m_e_t_e_r with
  213.                the matched portion deleted; otherwise the value of
  214.                this _p_a_r_a_m_e_t_e_r is substituted.  In the first form the
  215.                smallest matching _p_a_t_t_e_r_n is deleted and in the latter
  216.                form the largest matching _p_a_t_t_e_r_n is deleted.
  217.           $$$${{{{_p_a_r_a_m_e_t_e_r%%%%_p_a_t_t_e_r_n}}}}
  218.                $$$${{{{_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
  219.                end of the value of _p_a_r_a_m_e_t_e_r, then the value of this
  220.                substitution is the value of the _p_a_r_a_m_e_t_e_r with the
  221.                matched portion deleted; otherwise the value of this
  222.                _p_a_r_a_m_e_t_e_r is substituted.  In the first form the
  223.                smallest matching _p_a_t_t_e_r_n is deleted and in the latter
  224.                form the largest matching _p_a_t_t_e_r_n is deleted.
  225.  
  226.           In the above, _w_o_r_d is not evaluated unless it is to be used
  227.           as the substituted string, so that, in the following
  228.           example, ppppwwwwdddd is executed only if dddd is not set or is null:
  229.  
  230.                echo ${d:-`pwd`}
  231.  
  232.           If the colon (::::) is omitted from the above expressions, the
  233.           shell only checks whether _p_a_r_a_m_e_t_e_r is set or not (_I_t _i_s _n_o_t
  234.           _c_l_e_a_r _w_h_a_t _t_h_i_s _m_e_a_n_s).
  235.  
  236.           The following parameters are automatically set by the shell:
  237.                ####    The number of positional parameters in decimal.
  238.                ----    Flags supplied to the shell on invocation or by
  239.                     the sssseeeetttt command.
  240.                ????    The decimal value returned by the last
  241.                     synchronously executed command.
  242.                $$$$    The process number of this shell.
  243.                !!!!    The process number of the last background command
  244.                     invoked.
  245.                ~~~~    The shell reserves all variables beginning with a
  246.                     ~~~~ for its own internal use and these variables
  247.                     cannot be accessed by the user.
  248.  
  249.           The following parameters are used by the shell:
  250.                CCCCDDDDPPPPAAAATTTTHHHH
  251.                     The search path for the _c_d command.  (Note that
  252.                     because a colon is used by MSDOS to indicate a
  253.                     drive, a semi-colon is used to separate the path
  254.                     names instead of a colon - this implies that the
  255.                     CDPATH variable must be set using single or double
  256.                     quotes to surround the value).
  257.                CCCCOOOOMMMMSSSSPPPPEEEECCCC
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 11/6/90)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  269.  
  270.  
  271.  
  272.                     When the shell has to process an MSDOS ._b_a_t file,
  273.                     it expects the file indicated by the value of this
  274.                     environment variable to be an executable program
  275.                     capable of processing the MSDOS ._b_a_t file.  The
  276.                     program is invoked with the arguments ////cccc
  277.                     bbbbaaaatttt____ffffiiiilllleeee____nnnnaaaammmmeeee.
  278.                EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD____LLLLIIIINNNNEEEE
  279.                     This parameter defines a file containing a list of
  280.                     command which can accept an Extended Command Line
  281.                     using the indirect command file character @@@@.  When
  282.                     a command which can process the Extended Command
  283.                     Line finds a parameter starting with a @@@@ in the
  284.                     command list, treats the rest of the parameter as
  285.                     a file and reads the parameters from that file.
  286.                     Examples of this functionality include the
  287.                     Standard LLLLiiiinnnnkkkkeeeerrrr and LLLLiiiibbbbrrrraaaarrrriiiiaaaannnn.  The filename
  288.                     defined by EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD____LLLLIIIINNNNEEEE contains a list of
  289.                     command (including the .exe or .com extension)
  290.                     separated by a newlines.   If the command is in
  291.                     upper case, the file name on the command line is
  292.                     set up with backslashes as the directory
  293.                     separator.  Otherwise, slashes (Unix style) are
  294.                     used.  This functionality allows the user to get
  295.                     round the 127 byte command line length limit of
  296.                     MSDOS.
  297.                HHHHIIIISSSSTTTTFFFFIIIILLLLEEEE
  298.                     The file where command history is saved across
  299.                     login sessions.  The default value is
  300.                     $$$$HHHHOOOOMMMMEEEE////hhhhiiiissssttttoooorrrryyyy....sssshhhh.
  301.                HHHHOOOOMMMMEEEE The default argument (home directory) for the _c_d
  302.                     command.
  303.                IIIIFFFFSSSS  Internal field separators, normally ssssppppaaaacccceeee, ttttaaaabbbb,
  304.                     and nnnneeeewwww----lllliiiinnnneeee.
  305.                MMMMAAAAIIIILLLL If this parameter is set to the name of a mail
  306.                     file _a_n_d the MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH parameter is not set, the
  307.                     shell informs the user of the arrival of mail in
  308.                     the specified file.
  309.                MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK
  310.                     This parameter specifies how often (in seconds)
  311.                     the shell will check for the arrival of mail in
  312.                     the files specified by the MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH or MMMMAAAAIIIILLLL
  313.                     parameters.  If set to 0, the shell will check
  314.                     before each prompt.
  315.                MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH
  316.                     A semi-colon (;;;;) separated list of file names.  If
  317.                     this parameter is set, the shell informs the user
  318.                     of the arrival of mail in any of the specified
  319.                     files. Each file name can be followed by %%%% and a
  320.                     message that will be printed when the modification
  321.                     time changes.  The default message is "_y_o_u _h_a_v_e
  322.                     _m_a_i_l".
  323.                PPPPAAAATTTTHHHH The search path for commands (see _E_x_e_c_u_t_i_o_n
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 11/6/90)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  335.  
  336.  
  337.  
  338.                     below).
  339.                      The user may not change PPPPAAAATTTTHHHH if executing under
  340.                     _r_s_h.  (Note that because a colon is used by MSDOS
  341.                     to indicate a drive, a semi-colon is used to
  342.                     separate the path names instead of a colon - this
  343.                     implies that the PATH variable must be set using
  344.                     single or double quotes to surround the value).
  345.                     The Shell automatically converts Unix format PPPPAAAATTTTHHHH
  346.                     assignments to MSDOS format when appropriate.  A
  347.                     assignment is converted if there are no semi-
  348.                     colons, no backslashes and one or more colons.  If
  349.                     there is only one colon, it must not be the second
  350.                     character of the new value.
  351.                PPPPSSSS1111  Primary prompt string, by default ``$$$$ ''.
  352.                PPPPSSSS2222  Secondary prompt string, by default ``>>>> ''.
  353.                SSSSHHHHEEEELLLLLLLL
  354.                     When the shell is invoked, it scans the
  355.                     environment (see _E_n_v_i_r_o_n_m_e_n_t below) for this name.
  356.                     If it is found and there is an 'r' in the file
  357.                     name part of its value, the shell becomes a
  358.                     restricted shell.  The shell also uses this
  359.                     variable to decide which program to spawn to
  360.                     interpret shell scripts (see _E_x_e_c_u_t_i_o_n below).
  361.                TTTTMMMMPPPP  The location of temporary files created by the
  362.                     shell.  If this variable is not defined, the Shell
  363.                     uses the HHHHOOOOMMMMEEEE directory for temporary files.
  364.                     Failing that, the root directory of the current
  365.                     drive is used.
  366.           The shell gives default values to PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, SSSSHHHHEEEELLLLLLLL,
  367.           HHHHOOOOMMMMEEEE and IIIIFFFFSSSS.
  368.  
  369.         BBBBllllaaaannnnkkkk IIIInnnntttteeeerrrrpppprrrreeeettttaaaattttiiiioooonnnn
  370.           After parameter and command substitution, the results of
  371.           substitution are scanned for internal field separator
  372.           characters (those found in IIIIFFFFSSSS) and split into distinct
  373.           arguments where such characters are found.  Explicit null
  374.           arguments ("""""""" or '''''''') are retained.  Implicit null arguments
  375.           (those resulting from _p_a_r_a_m_e_t_e_r_s that have no values) are
  376.           removed.
  377.         FFFFiiiilllleeee NNNNaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn
  378.           Following substitution, each command _w_o_r_d is scanned for the
  379.           characters ****, ???? and [[[[.  If one of these characters appears
  380.           the word is regarded as a _p_a_t_t_e_r_n.  The word is replaced
  381.           with alphabetically sorted file names that match the
  382.           pattern.  If no file name is found that matches the pattern,
  383.           the word is left unchanged.  The character .... at the start of
  384.           a file name or immediately following a ////, as well as the
  385.           character //// itself, must be matched explicitly.  When
  386.           matching patterns for file names, the shell ignores the case
  387.           of the pattern and the file directory entries.  Generated
  388.           file names are always in lower case.
  389.                ****    Matches any string, including the null string.
  390.  
  391.  
  392.  
  393.      Page 6                                          (printed 11/6/90)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  401.  
  402.  
  403.  
  404.                ????    Matches any single character.
  405.                [[[[ ............ ]]]]
  406.                     Matches any one of the enclosed characters.  A
  407.                     pair of characters separated by ---- matches any
  408.                     character lexically between the pair, inclusive.
  409.                     If the first character following the opening ``[''
  410.                     is a ````````!!!!'''''''' any character not enclosed is matched.
  411.  
  412.           If the shell has to open or create the file ////ddddeeeevvvv////ttttttttyyyy or
  413.           ////ddddeeeevvvv////nnnnuuuullllllll (which are Unix special files), they are converted
  414.           to the equivalent MSDOS file names (////ddddeeeevvvv////ccccoooonnnn and ////ddddeeeevvvv////nnnnuuuullll
  415.           respectively).  Any user programs which could expect
  416.           ////ddddeeeevvvv////ttttttttyyyy or ////ddddeeeevvvv////nnnnuuuullllllll as arguments must do its own mapping
  417.           to the MSDOS equivalents.
  418.  
  419.         QQQQuuuuoooottttiiiinnnngggg
  420.           The following characters have a special meaning to the shell
  421.           and cause termination of a word unless quoted:
  422.  
  423.                ;;;;  &&&&  ((((  ))))  ||||  ^^^^  <<<<  >>>>  nnnneeeewwww----lllliiiinnnneeee  ssssppppaaaacccceeee  ttttaaaabbbb
  424.  
  425.           A character may be _q_u_o_t_e_d (i.e., made to stand for itself)
  426.           by preceding it with a \\\\.  The pair \\\\nnnneeeewwww----lllliiiinnnneeee is ignored.
  427.           All characters enclosed between a pair of single quote marks
  428.           (''''''''), except a single quote, are quoted.  Inside double
  429.           quote marks (""""""""), parameter and command substitution occurs
  430.           and \\\\ quotes the characters \\\\, ````, """", and $$$$. """"$$$$****"""" is
  431.           equivalent to """"$$$$1111 $$$$2222 ............"""", whereas """"$$$$@@@@"""" is equivalent to
  432.           """"$$$$1111"""" """"$$$$2222"""" .............
  433.  
  434.         PPPPrrrroooommmmppppttttiiiinnnngggg
  435.           When used interactively, the shell prompts with the value of
  436.           PPPPSSSS1111 before reading a command.  If at any time a new-line is
  437.           typed and further input is needed to complete a command, the
  438.           secondary prompt (i.e., the value of PPPPSSSS2222) is issued.
  439.  
  440.           Many people like to have the shell provide them with useful
  441.           information in their prompt.  To accommodate this, the shell
  442.           recognises special sequences of characters in the values of
  443.           PPPPSSSS1111 and PPPPSSSS2222, and substitutes the appropriate information for
  444.           them.  The special sequences and what they signify are:
  445.  
  446.                %%%%dddd   Place the current date, in the form DAY DD-MM-YY
  447.                     into the prompt.
  448.  
  449.                %%%%eeee   Place the current event number (as defined by the
  450.                     hhhhiiiissssttttoooorrrryyyy command) into the prompt.  If history
  451.                     evaluation has been turned off (via hhhhiiiissssttttoooorrrryyyy ----dddd),
  452.                     no number will be substituted in (i.e. the %%%%eeee will
  453.                     be removed).
  454.  
  455.                %%%%nnnn   Place the current working drive into the prompt.
  456.  
  457.  
  458.  
  459.      Page 7                                          (printed 11/6/90)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  467.  
  468.  
  469.  
  470.                %%%%pppp   Place the current working directory into the
  471.                     prompt.
  472.  
  473.                %%%%tttt   Place the current time of day, in the form HH:MM
  474.                     into the prompt.  The time is on a 24 hour clock,
  475.                     i.e. 1:30 in the afternoon will be 13:30.
  476.  
  477.                %%%%vvvv   Place the MSDOS version number, in the form  MSDOS
  478.                     MM:MM into the prompt.
  479.  
  480.                %%%%%%%%   Place the character % into the prompt.
  481.  
  482.                \\\\xxxxxxxxxxxx Place the character _\_x_x_x into the prompt.  The
  483.                     processing of escape sequences is the same as that
  484.                     for eeeecccchhhhoooo.
  485.  
  486.           Some of these facilities are of more use than others.
  487.  
  488.         IIIInnnnppppuuuutttt////OOOOuuuuttttppppuuuutttt
  489.           Before a command is executed, its input and output may be
  490.           redirected using a special notation interpreted by the
  491.           shell.  The following may appear anywhere in a simple-
  492.           command or may precede or follow a _c_o_m_m_a_n_d and are _n_o_t
  493.           passed on to the invoked command; substitution occurs before
  494.           _w_o_r_d or _d_i_g_i_t is used:
  495.  
  496.           <<<<wwwwoooorrrrdddd         Use file _w_o_r_d as standard input (file
  497.                         descriptor 0).
  498.           >>>>wwwwoooorrrrdddd         Use file _w_o_r_d as standard output (file
  499.                         descriptor 1).  If the file does not exist it
  500.                         is created; otherwise, it is truncated to zero
  501.                         length.
  502.           >>>>>>>>wwwwoooorrrrdddd        Use file _w_o_r_d as standard output.  If the file
  503.                         exists output is appended to it (by first
  504.                         seeking to the end-of-file); otherwise, the
  505.                         file is created.
  506.           <<<<<<<<[----]wwwwoooorrrrdddd     The shell input is read up to a line that is
  507.                         the same as _w_o_r_d, or to an end-of-file.  The
  508.                         resulting document becomes the standard input.
  509.                         If any character of _w_o_r_d is quoted, no
  510.                         interpretation is placed upon the characters
  511.                         of the document; otherwise, parameter and
  512.                         command substitution occurs, (unescaped)
  513.                         \\\\nnnneeeewwww----lllliiiinnnneeee is ignored, and \\\\ must be used to
  514.                         quote the characters \\\\, $$$$, ````, and the first
  515.                         character of _w_o_r_d.  If ---- is appended to <<<<<<<<,
  516.                         all leading tabs are stripped from _w_o_r_d and
  517.                         from the document.
  518.           <<<<&&&&ddddiiiiggggiiiitttt       Use the file associated with file descriptor
  519.                         _d_i_g_i_t as standard input.  Similarly for the
  520.                         standard output using >>>>&&&&ddddiiiiggggiiiitttt.
  521.           <<<<&&&&----           The standard input is closed.  Similarly for
  522.  
  523.  
  524.  
  525.      Page 8                                          (printed 11/6/90)
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  533.  
  534.  
  535.  
  536.                         the standard output using >>>>&&&&----.
  537.           nnnn<<<<>>>>wwwwoooorrrrdddd       causes the file _w_o_r_d to be opened on file
  538.                         descriptor _n for both reading and writing.
  539.                         The file must already exist.
  540.  
  541.           If any of the above is preceded by a digit, the file
  542.           descriptor which will be associated with the file is that
  543.           specified by the digit (instead of the default 0 or 1).  For
  544.           example:
  545.  
  546.                ... 2>&1
  547.  
  548.           associates file descriptor 2 with the file currently
  549.           associated with file descriptor 1.
  550.  
  551.           The order in which redirections are specified is
  552.           significant.  The shell evaluates redirections left-to-
  553.           right.  For example:
  554.  
  555.                ... 1>_x_x_x 2>&1
  556.  
  557.           first associates file descriptor 1 with file _x_x_x.  It
  558.           associates file descriptor 2 with the file associated with
  559.           file descriptor 1 (i.e. _x_x_x).  If the order of redirections
  560.           were reversed, file descriptor 2 would be associated with
  561.           the terminal (assuming file descriptor 1 had been) and file
  562.           descriptor 1 would be associated with file _x_x_x .
  563.  
  564.           The environment for the execution of a command contains the
  565.           file descriptors of the invoking shell as modified by
  566.           input/output specifications.
  567.  
  568.           Redirection of output is not allowed in the restricted
  569.           shell.
  570.  
  571.         EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt
  572.           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
  573.           pairs that is passed to an executed program in the same way
  574.           as a normal argument list.  The shell interacts with the
  575.           environment in several ways.  On invocation, the shell scans
  576.           the environment and creates a parameter for each name found,
  577.           giving it the corresponding value.  If the user modifies the
  578.           value of any of these parameters or creates new parameters,
  579.           none of these affects the environment unless the eeeexxxxppppoooorrrrtttt
  580.           command is used to bind the shell's parameter to the
  581.           environment (see also sssseeeetttt ----aaaa).  A parameter may be removed
  582.           from the environment with the uuuunnnnsssseeeetttt command.  The
  583.           environment seen by any executed command is thus composed of
  584.           any unmodified name-value pairs originally inherited by the
  585.           shell, minus any pairs removed by uuuunnnnsssseeeetttt, plus any
  586.           modifications or additions, all of which must be noted in
  587.           eeeexxxxppppoooorrrrtttt commands.
  588.  
  589.  
  590.  
  591.      Page 9                                          (printed 11/6/90)
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  599.  
  600.  
  601.  
  602.           The environment for any _s_i_m_p_l_e-_c_o_m_m_a_n_d may be augmented by
  603.           prefixing it with one or more assignments to parameters.
  604.           Thus:
  605.  
  606.                TERM=450 cmd args             and
  607.                (export TERM; TERM=450; cmd args)
  608.  
  609.           are equivalent (as far as the execution of _c_m_d is
  610.           concerned).
  611.  
  612.           If the ----kkkk flag is set, _a_l_l keyword arguments are placed in
  613.           the environment, even if they occur after the command name.
  614.           The following first prints aaaa====bbbb cccc and cccc:
  615.  
  616.                echo a=b c
  617.                set -k
  618.                echo a=b c
  619.  
  620.         SSSSiiiiggggnnnnaaaallllssss
  621.           The INTERRUPT and QUIT signals for an invoked command are
  622.           ignored if the command is followed by &&&&; otherwise signals
  623.           have the values inherited by the shell from its parent, with
  624.           the exception of signal 11 (but see also the ttttrrrraaaapppp command
  625.           below).
  626.  
  627.         HHHHiiiissssttttoooorrrryyyy
  628.           When reading input from an interactive terminal, a ``!'' at
  629.           the start of a line signals to the shell that it should
  630.           attempt to perform a history subsitution.  A history
  631.           subsitution is a short-hand method which allows the user to
  632.           recall a previous command for execution or editing.  The
  633.           recalled command is placed in the command line for editing
  634.           or passing to the rest of the shell for normal processing.
  635.           A history substitution takes the form:
  636.  
  637.                !!!! [ ! | _s_t_r | _n_u_m ] _t_e_r_m_i_n_a_t_o_r
  638.  
  639.           !!!!!!!! will place the previous command in the command line.
  640.           !!!!_n_u_m will place the history command with the specified
  641.           number in the command line.  !!!!_s_t_r will find the most recent
  642.           command line that started with the characters in _s_t_r.
  643.  
  644.           The _t_e_r_m_i_n_a_t_o_r determines what action is performed after the
  645.           history line has been found.  If the original history
  646.           command is entered using the <<<<rrrreeeettttuuuurrrrnnnn>>>> key, the new command
  647.           line is passed directly to the shell.  If the <<<<eeeennnndddd>>>> key is
  648.           pressed, the new command line can be edited in the manner
  649.           described below.
  650.  
  651.         CCCCoooommmmmmmmaaaannnndddd LLLLiiiinnnneeee EEEEddddiiiittttiiiinnnngggg
  652.           When reading input from an interactive terminal, certain
  653.           keystrokes allow the current input line to be edited.  The
  654.  
  655.  
  656.  
  657.      Page 10                                         (printed 11/6/90)
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  665.  
  666.  
  667.  
  668.           following keystrokes corresponding to the following
  669.           functions are defined in the initialisation file sssshhhh....iiiinnnniiii.
  670.           The keywords in the initialisation file which provide the
  671.           functions are listed below:
  672.  
  673.           RRRRiiiigggghhhhtttt
  674.                Move the cursor right one character
  675.  
  676.           WWWWoooorrrrddddRRRRiiiigggghhhhtttt
  677.                Move the cursor right one word
  678.  
  679.           LLLLeeeefffftttt Move the cursor left one character
  680.  
  681.           WWWWoooorrrrddddLLLLeeeefffftttt
  682.                Move the cursor left one word
  683.  
  684.           PPPPrrrreeeevvvviiiioooouuuussss
  685.                Get the previous command from the history file
  686.  
  687.           NNNNeeeexxxxtttt Get the next command from the history file
  688.  
  689.           IIIInnnnsssseeeerrrrtttt
  690.                Toggle insert/overwrite mode (note the shape of the
  691.                cursor changes to indicate the current mode)
  692.  
  693.           DDDDeeeelllleeeetttteeeeRRRRiiiigggghhhhtttt
  694.                Delete the current character unless the cursor is at
  695.                the end of line when no action is taken
  696.  
  697.           SSSSttttaaaarrrrtttt
  698.                Move the cursor to the start of the command
  699.  
  700.           CCCCoooommmmpppplllleeeetttteeee
  701.                Attempt to complete the filename.  The shell attempts
  702.                to complete the file name at the current cursor
  703.                position.  The file name is delimited by white space
  704.                characters.  If the shell is unable to complete the
  705.                file name (ie no match can be found in the appropriate
  706.                directory), the bell is rung.  If a single match is
  707.                found, the new file name is displayed.  If multiple
  708.                matches are found, the file name is replaced by the
  709.                longest non-unique part of the file name and the bell
  710.                is rung.
  711.  
  712.           EEEEnnnndddd  Move the cursor to the end of the command, unless the
  713.                first character of the command is a !!!!, in which case
  714.                the appropriate history search is done.  The cursor is
  715.                placed at the end of the command line.
  716.  
  717.           FFFFlllluuuusssshhhh
  718.                Delete to the end of the line
  719.  
  720.  
  721.  
  722.  
  723.      Page 11                                         (printed 11/6/90)
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  731.  
  732.  
  733.  
  734.           SSSSccccaaaannnnBBBBaaaacccckkkkwwwwaaaarrrrdddd
  735.                Search backwards from the current history command for
  736.                the next match against the last history request or the
  737.                string currently in the command line if there has been
  738.                no previous history request.
  739.  
  740.           SSSSccccaaaannnnFFFFoooorrrreeeewwwwaaaarrrrdddd
  741.                Search forewards from the current history command for
  742.                the next match against the last history request or the
  743.                string currently in the command line if there has been
  744.                no previous history request.
  745.  
  746.           CCCClllleeeeaaaarrrr
  747.                Erase the complete line.
  748.  
  749.           DDDDiiiirrrreeeeccccttttoooorrrryyyy
  750.                Display the file name list matching the partially
  751.                entered file name under the cursor.  If no matches are
  752.                found the bell is rung.  To display the whole
  753.                directory, enter the directory name followed by a slash
  754.                ////.  After the directory listing has been displayed, the
  755.                entered command line is redisplayed.
  756.  
  757.           DDDDeeeelllleeeetttteeeeLLLLeeeefffftttt
  758.                Delete the character to the left of the cursor.
  759.  
  760.           RRRReeeettttuuuurrrrnnnn
  761.                Execute the command line, unless the first character of
  762.                the command is a !!!!, in which case the appropriate
  763.                history processing is done.  _T_h_i_s _i_s _t_h_e _a_c_t_u_a_l _k_e_y
  764.                _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 _b_y _t_h_e _i_n_i_t_i_a_l_i_s_a_t_i_o_n
  765.                _f_i_l_e.
  766.  
  767.         IIIInnnniiiittttiiiiaaaalllliiiissssaaaattttiiiioooonnnn FFFFiiiilllleeee
  768.           When the shell is run in interactive mode, the Command Line
  769.           Editing keys and other user configuration parameters are
  770.           read from the initialisation file _s_h._i_n_i.  This shell looks
  771.           for this file in the same directory as the sssshhhh executable
  772.           which is running.  It does not use the SSSSHHHHEEEELLLLLLLL environment
  773.           variable or search the directories in the PPPPAAAATTTTHHHH environment
  774.           variable.  At present, there are two types of entry in this
  775.           file: keyboard configuration; and others.  The entry is
  776.           contained in a single line and consists of a keyword (in
  777.           upper or lower case), white space, an equals symbols, white
  778.           space and one or two numeric values (see _s_t_r_t_o_l for valid
  779.           formats where _b_a_s_e parameter is zero), followed by an end of
  780.           line character.
  781.  
  782.           For the keyboard entries, the numeric values give the MSDOS
  783.           Function 8 (Console Input without Echo) return values for
  784.           that entry.  Note that extended codes (function keys)
  785.           require two calls to this function.  The first call returns
  786.  
  787.  
  788.  
  789.      Page 12                                         (printed 11/6/90)
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  797.  
  798.  
  799.  
  800.           zero and the second the extended code.  In the configuration
  801.           file, a first numeric value of zero indicates a extended
  802.           code and must be followed by a second value.  A non-zero
  803.           first numeric value must not be followed by anything else on
  804.           the line.
  805.  
  806.           Other entries must only have one numeric value.  A zero
  807.           value disables the function and a non-zero value enables the
  808.           function.  At present, there are two other functions:
  809.  
  810.           BBBBeeeellllllll Enable/disable warning bells
  811.  
  812.           HHHHaaaallllffffHHHHeeeeiiiigggghhhhtttt
  813.                Use full or halfheight block cursor to indicate Insert
  814.                mode
  815.  
  816.           Invalid lines or lines beginning with a #### are ignored.
  817.  
  818.           The following table gives the list of valid keywords and
  819.           their default values:
  820.           _________________________________________________________________________
  821.            Keyword            First numeric   Second numeric   Actual Key
  822.           _________________________________________________________________________
  823.            KEYBOARD ENTRIES
  824.            ScanBackward       0               0x49             PAGE UP
  825.            ScanForeward       0               0x51             PAGE DOWN
  826.            Previous           0               0x48             UP ARROW
  827.            Next               0               0x50             DOWN ARROW
  828.            Left               0               0x4b             LEFT ARROW
  829.            Right              0               0x4d             RIGHT ARROW
  830.            WordRight          0               0x74             Control RIGHT ARROW
  831.            WordLeft           0               0x73             Control LEFT ARROW
  832.            Start              0               0x47             HOME
  833.            Clear              0               0x76             Control PAGE DOWN
  834.            Flush              0               0x75             Control END
  835.            End                0               0x4f             END
  836.            Insert             0               0x52             INSERT
  837.            DeleteRight        0               0x53             DELETE
  838.            DeleteLeft         0x08                             BACKSPACE
  839.            Complete           0               0x77             Control HOME
  840.            Directory          0               0x0f             Shift TAB
  841.           _________________________________________________________________________
  842.            OTHER FUNCTIONS
  843.            Bell               0
  844.            HalfHeight         0
  845.           _________________________________________________________________________
  846.  
  847.         EEEExxxxeeeeccccuuuuttttiiiioooonnnn
  848.           Each time a command is executed, the above substitutions are
  849.           carried out.  If the command name matches one of the _S_p_e_c_i_a_l
  850.           _C_o_m_m_a_n_d_s listed below, it is executed in the shell process.
  851.           If the command name does not match a _S_p_e_c_i_a_l _C_o_m_m_a_n_d, but
  852.           matches the name of a defined function, the function is
  853.           executed in the shell process (note how this differs from
  854.  
  855.      Page 13                                         (printed 11/6/90)
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  863.  
  864.  
  865.  
  866.           the execution of shell procedures).  The positional
  867.           parameters $$$$1111, $$$$2222, ....  are set to the arguments of the
  868.           function.  If the command name matches neither a _S_p_e_c_i_a_l
  869.           _C_o_m_m_a_n_d nor the name of a defined function, a new process is
  870.           created and an attempt is made to execute the command via
  871.           _e_x_e_c(2).
  872.  
  873.           The shell parameter PPPPAAAATTTTHHHH defines the search path for the
  874.           directory containing the command.  Alternative directory
  875.           names are separated by a semi-colon (;;;;).  The default path
  876.           is ;;;;cccc::::////bbbbiiiinnnn;;;;cccc::::////uuuussssrrrr////bbbbiiiinnnn (specifying the current directory,
  877.           cccc::::////bbbbiiiinnnn, and cccc::::////uuuussssrrrr////bbbbiiiinnnn, in that order).  Note that the
  878.           current directory is specified by a null path name, which
  879.           can appear immediately after the equal sign or between the
  880.           semi-colon delimiters anywhere else in the path list.  If
  881.           the command name contains a //// or starts with xxxx:::: (where x is
  882.           a drive letter) the search path is not used; such commands
  883.           will not be executed by the restricted shell.  Otherwise,
  884.           each directory in the path is searched for an executable
  885.           file.  Executable files are indicated by a .exe or .com
  886.           extension.  This extension is automatically supplied by the
  887.           shell and not have to be entered by the user.
  888.  
  889.           If the file with a .com or .exe extension cannot be found in
  890.           the directory, the file is opened and first 512 characters
  891.           are read.  If there are no characters in the block with a
  892.           value in the range 0 to 7, the file is assumed to be a
  893.           script file containing shell commands.  Note that the shell
  894.           will check the file and if that file does not exist or is
  895.           not a script, it will try the file with an extension of ....sssshhhh.
  896.           If a ....sssshhhh file is found, that will be processed.  A sub-shell
  897.           (given by the environment variable SSSSHHHHEEEELLLLLLLL) is spawned to read
  898.           it.
  899.  
  900.           If the script file starts with the a line of the form #!
  901.           _i_n_t_e_r_p_r_e_t_e_r [_a_r_g_u_m_e_n_t_s], the interpreter is invoked instead
  902.           of the shell to process the script.  Optional arguments can
  903.           be supplied in the script file which are passed before the
  904.           name of the script file.  Thus, if the file _d_e_m_o contained
  905.           the following string as the first line
  906.  
  907.                #! perl -sP
  908.  
  909.           Entering _d_e_m_o _n_a_m_e would be equivalent to entering the _p_e_r_l
  910.           -_s_P _n_a_m_e at the command prompt.  Note that no other
  911.           processing of the first line other that the separation (by
  912.           white space) into arguments is done.
  913.  
  914.           If none of the above conditions for a executable file are
  915.           detected and a file with a .bat extension exists in the
  916.           directory, the command processor given by the CCCCOOOOMMMMSSSSPPPPEEEECCCC
  917.           environment variable is spawned to process the file.  This
  918.  
  919.  
  920.  
  921.      Page 14                                         (printed 11/6/90)
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  929.  
  930.  
  931.  
  932.           is normally the standard MSDOS _c_o_m_m_a_n_d._c_o_m processor.
  933.  
  934.           A parenthesized command is also executed in a sub-shell.
  935.  
  936.         SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss
  937.           Input/output redirection is permitted for these commands.
  938.           File descriptor 1 is the default output location.
  939.  
  940.           ::::    No effect; the command does nothing.  A zero exit code
  941.                is returned.
  942.           _l_e_t_t_e_r::::
  943.                Select the drive specified by _l_e_t_t_e_r.
  944.           .... _f_i_l_e
  945.                Read and execute commands from _f_i_l_e and return.  The
  946.                search path specified by PPPPAAAATTTTHHHH is used to find the
  947.                directory containing _f_i_l_e.
  948.           bbbbrrrreeeeaaaakkkk [ _n ]
  949.                Exit from the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee loop, if any.  If
  950.                _n is specified, break _n levels.
  951.           bbbbuuuuiiiillllttttiiiinnnn [ _a_r_g_s ... ]
  952.                Force the selection of the bbbbuuuuiiiillllttttiiiinnnn version of a
  953.                command.  The builtin shell command selected by the
  954.                first _a_r_g_s value is executed with the parameters
  955.                defined by the remaining _a_r_g_ss.  If no arguments are
  956.                given, a list of all _b_u_i_l_t_i_n commands is printed.
  957.  
  958.                If the first argument is one of the following, the
  959.                processing of the builtin command in the following
  960.                arguments are changed as indicated:
  961.                ----aaaa   Set the following builtin commands to use builtin
  962.                     version in preference to any function or external
  963.                     versions.
  964.                ----dddd   Set the following builtin commands to use the
  965.                     function or external version in preference to the
  966.                     builtin version.
  967.                ----ssss   Display the current status of the following
  968.                     builtin commands.
  969.           ccccoooonnnnttttiiiinnnnuuuueeee [ _n ]
  970.                Resume the next iteration of the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee
  971.                loop.  If _n is specified, resume at the _n-th enclosing
  972.                loop.
  973.           ccccdddd [ _a_r_g ]
  974.                Change the current directory to _a_r_g.  The shell
  975.                parameter HHHHOOOOMMMMEEEE is the default _a_r_g.  The shell parameter
  976.                CCCCDDDDPPPPAAAATTTTHHHH defines the search path for the directory
  977.                containing _a_r_g.  Alternative directory names are
  978.                separated by a semi-colon (;;;;).  The default path is
  979.                <<<<nnnnuuuullllllll>>>> (specifying the current directory).  Note that
  980.                the current directory is specified by a null path name,
  981.                which can appear immediately after the equal sign or
  982.                between the semi-colon delimiters anywhere else in the
  983.                path list.  If _a_r_g begins with a //// or xxxx:::: (where x is a
  984.  
  985.  
  986.  
  987.      Page 15                                         (printed 11/6/90)
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  995.  
  996.  
  997.  
  998.                drive letter), the search path is not used.  Otherwise,
  999.                each directory in the path is searched for _a_r_g.  The _c_d
  1000.                command may not be executed by _r_s_h.
  1001.           eeeecccchhhhoooo [ _a_r_g ... ]
  1002.                Echo arguments. EEEEcccchhhhoooo writes its arguments separated by
  1003.                blanks and terminated by a new-line on the standard
  1004.                output.  It also understands C-like escape conventions;
  1005.                beware of conflicts with the shell's use of \\\\:
  1006.                \\\\bbbb   backspace
  1007.                \\\\cccc   print line without new-line
  1008.                \\\\ffff   form-feed
  1009.                \\\\nnnn   new-line
  1010.                \\\\rrrr   carriage return
  1011.                \\\\tttt   tab
  1012.                \\\\vvvv   vertical tab
  1013.                \\\\\\\\   backslash
  1014.                \\\\_n   the 8-bit character whose ASCII code is the 1-, 2-
  1015.                     or 3-digit octal number _n, which must start with a
  1016.                     zero.
  1017.  
  1018.                _E_c_h_o is useful for producing diagnostics in command
  1019.                files and for sending known data into a pipe.
  1020.  
  1021.           eeeevvvvaaaallll [ _a_r_g ... ]
  1022.                The arguments are read as input to the shell and the
  1023.                resulting command(s) executed.
  1024.  
  1025.           eeeexxxxeeeecccc [ _a_r_g ... ]
  1026.                The command specified by the arguments is executed in
  1027.                place of this shell without creating a new process.
  1028.                Input/output arguments may appear and, if no other
  1029.                arguments are given, cause the shell input/output to be
  1030.                modified.
  1031.  
  1032.           eeeexxxxiiiitttt [ _n ]
  1033.                Causes a shell to exit with the exit status specified
  1034.                by _n.  If _n is omitted the exit status is that of the
  1035.                last command executed (an end-of-file will also cause
  1036.                the shell to exit.)
  1037.  
  1038.           eeeexxxxppppoooorrrrtttt [ _n_a_m_e ... ]
  1039.                The given _n_a_m_es are marked for automatic export to the
  1040.                _e_n_v_i_r_o_n_m_e_n_t of subsequently-executed commands.  If no
  1041.                arguments are given, a list of all names that are
  1042.                exported in this shell is printed.  Function names may
  1043.                _n_o_t be exported.
  1044.  
  1045.           ggggeeeettttoooopppptttt _o_p_t_s_t_r_i_n_g _n_a_m_e [ _a_r_g_s ... ]
  1046.                Parse command options and write them to standard
  1047.                output.  GGGGeeeettttoooopppptttt is used to break up options in command
  1048.                lines for easy parsing by shell procedures and to check
  1049.                for legal options.  _O_p_t_s_t_r_i_n_g is a string of recognized
  1050.  
  1051.  
  1052.  
  1053.      Page 16                                         (printed 11/6/90)
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1061.  
  1062.  
  1063.  
  1064.                option letters (see _g_e_t_o_p_t(3C)); if a letter is
  1065.                followed by a colon, the option is expected to have an
  1066.                argument which may or may not be separated from it by
  1067.                white space.  The special option -------- is used to delimit
  1068.                the end of the options.  If it is used explicitly,
  1069.                ggggeeeettttoooopppptttt will recognize it; otherwise, ggggeeeettttoooopppptttt will
  1070.                generate it; in either case, ggggeeeettttoooopppptttt will place it at
  1071.                the end of the options.  Each option is preceded by a ----
  1072.                and is in its own positional parameter; each option
  1073.                argument is also parsed into its own positional
  1074.                parameter.
  1075.  
  1076.                The following code fragment shows how one might process
  1077.                the arguments for a command that can take the options aaaa
  1078.                or bbbb, as well as the option oooo, which requires an
  1079.                argument:
  1080.  
  1081.                set -- `getopt abo: $*`
  1082.                if [ $? != 0 ]
  1083.                then
  1084.                     echo $USAGE
  1085.                     exit 2
  1086.                fi
  1087.                for i in $*
  1088.                do
  1089.                     case $i in
  1090.                     -a | -b)  FLAG=$i; shift;;
  1091.                     -o)       OARG=$2; shift 2;;
  1092.                     --)       shift; break;;
  1093.                     esac
  1094.                done
  1095.  
  1096.                This code will accept any of the following as
  1097.                equivalent:
  1098.  
  1099.                cmd -aoarg file file
  1100.                cmd -a -o arg file file
  1101.                cmd -oarg -a file file
  1102.                cmd -a -oarg -- file file
  1103.  
  1104.           hhhhiiiissssttttoooorrrryyyy [ ----ddddeeeeiiii ]
  1105.                The hhhhiiiissssttttoooorrrryyyy command, with no arguments, will print all
  1106.                the commands that are currently saved in the shell's
  1107.                history buffers.  As new commands are executed, and
  1108.                space in the buffers runs out, old commands will be
  1109.                deleted.  The hhhhiiiissssttttoooorrrryyyy commands prints out the stored
  1110.                commands with sequence numbers.  Negative numbered
  1111.                commands, through command number zero, are commands
  1112.                that were retrieved from the saved history file.
  1113.                Commands starting at one were entered during the
  1114.                current login session.  If a saved command contains
  1115.                embedded newlines, these will be printed out as the
  1116.  
  1117.  
  1118.  
  1119.      Page 17                                         (printed 11/6/90)
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1127.  
  1128.  
  1129.  
  1130.                sequence \\\\nnnn, so that individual command stay on one
  1131.                line.
  1132.  
  1133.                The arguments changes the way the shell processes
  1134.                history information as follows:
  1135.  
  1136.                ----dddd   Disable the saving of commands in the history
  1137.                     file.
  1138.  
  1139.                ----eeee   Enable the saving of commands in the history file.
  1140.  
  1141.                ----iiii   Initialise the history file.
  1142.  
  1143.           mmmmssssddddoooossss [ _n_a_m_e ... ]
  1144.                The given _n_a_m_es are marked _m_s_d_o_s format and if the ----mmmm
  1145.                flag is set, the values of the these _n_a_m_es are exported
  1146.                to child processes with any slashes in the value
  1147.                replaced by backslashes.  If no arguments are given, a
  1148.                list of all _m_s_d_o_s names is printed.
  1149.  
  1150.           ppppwwwwdddd  Print the current working directory.
  1151.  
  1152.           rrrreeeeaaaadddd [ _n_a_m_e ... ]
  1153.                One line is read from the standard input and the first
  1154.                word is assigned to the first _n_a_m_e, the second word to
  1155.                the second _n_a_m_e, etc., with leftover words assigned to
  1156.                the last _n_a_m_e.  The return code is 0 unless an end-of-
  1157.                file is encountered.
  1158.  
  1159.           rrrreeeeaaaaddddoooonnnnllllyyyy [ _n_a_m_e ... ]
  1160.                The given _n_a_m_es are marked _r_e_a_d_o_n_l_y and the values of
  1161.                the these _n_a_m_es may not be changed by subsequent
  1162.                assignment.  If no arguments are given, a list of all
  1163.                _r_e_a_d_o_n_l_y names is printed.
  1164.  
  1165.           rrrreeeettttuuuurrrrnnnn [ _n ]
  1166.                Causes a function to exit with the return value
  1167.                specified by _n.  If _n is omitted, the return status is
  1168.                that of the last command executed.
  1169.  
  1170.           sssseeeetttt [ --------aaaaeeeeffffkkkkmmmmnnnnttttuuuuvvvvxxxx [ _a_r_g ... ] ]
  1171.  
  1172.                ----aaaa   Mark variables which are modified or created for
  1173.                     export.
  1174.  
  1175.                ----eeee   Exit immediately if a command exits with a non-
  1176.                     zero exit status.
  1177.  
  1178.                ----ffff   Disable file name generation
  1179.  
  1180.                ----kkkk   All keyword arguments are placed in the
  1181.                     environment for a command, not just those that
  1182.  
  1183.  
  1184.  
  1185.      Page 18                                         (printed 11/6/90)
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1193.  
  1194.  
  1195.  
  1196.                     precede the command name.
  1197.  
  1198.                ----mmmm   For those variables marked as mmmmssssddddoooossss variables, the
  1199.                     values are exported to child processes with the
  1200.                     slashes replaced by backslashes.  Most MSDOS
  1201.                     utilities do not care if a file name contains a
  1202.                     slash or backslash as a directory separator.
  1203.                     However, some like the _l_i_n_k_e_r require backslashes
  1204.                     in the value of the LLLLIIIIBBBB variable.
  1205.  
  1206.                ----nnnn   Read commands but do not execute them.
  1207.  
  1208.                ----tttt   Exit after reading and executing one command.
  1209.  
  1210.                ----uuuu   Treat unset variables as an error when
  1211.                     substituting.
  1212.  
  1213.                ----vvvv   Print shell input lines as they are read.
  1214.  
  1215.                ----xxxx   Print commands and their arguments as they are
  1216.                     executed.
  1217.  
  1218.                --------   Do not change any of the flags; useful in setting
  1219.                     $$$$1111 to ----.
  1220.  
  1221.                Using ++++ rather than ---- causes these flags to be turned
  1222.                off.  These flags can also be used upon invocation of
  1223.                the shell.  The current set of flags may be found in
  1224.                $$$$----.  The remaining arguments are positional parameters
  1225.                and are assigned, in order, to $$$$1111, $$$$2222, ....  If no
  1226.                arguments are given the values of all names are
  1227.                printed.
  1228.  
  1229.           sssshhhhiiiifffftttt [ _n ]
  1230.                The positional parameters from $$$$nnnn++++1111 ...  are renamed $$$$1111
  1231.                ....  If _n is not given, it is assumed to be 1.
  1232.  
  1233.           sssswwwwaaaapppp [ _o_p_t_i_o_n_s ]
  1234.                This command defines how the shell will handle
  1235.                swapping.  The options are
  1236.  
  1237.                ooooffffffff  Disable swapping.  The shell remains in memory
  1238.                     whilst the child is running and reduces the
  1239.                     available memory by about 200K (depending on the
  1240.                     size of the environment and history).
  1241.  
  1242.                oooonnnn   Enable all devices.  The shell will swap out to
  1243.                     either expanded or extended memory or to disk,
  1244.                     execute the command and then swap back in.
  1245.                     Whilest swapped, the shell reduces the available
  1246.                     memory by about 3K.
  1247.  
  1248.  
  1249.  
  1250.  
  1251.      Page 19                                         (printed 11/6/90)
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1259.  
  1260.  
  1261.  
  1262.                eeeexxxxppppaaaannnndddd
  1263.                     Enable swapping to Expanded Memory.  The EMS
  1264.                     driver must exist on your system for this to work.
  1265.  
  1266.                eeeexxxxtttteeeennnntttt [ _s_t_a_r_t _a_d_d_r_e_s_s ]
  1267.                     Enable swapping to Extended Memory.  If you have
  1268.                     an XMS driver on your system, the shell will use
  1269.                     the XMS driver.  Otherwise, the BIOS Interrupt 15
  1270.                     interface is used.  The optional start address
  1271.                     defines the based address in the Extended Memory
  1272.                     at which point the shell writes its swap area when
  1273.                     the BIOS interface is used.  The default location
  1274.                     is _0_x_1_0_0_0_0_0.
  1275.  
  1276.                ddddiiiisssskkkk Enable swapping to disk.  The shell creates a
  1277.                     temporary file and saves itself in it.  On
  1278.                     completion, the file is deleted.  This is the
  1279.                     slowest method of swapping.
  1280.  
  1281.                With no options, the current swapping options are
  1282.                displayed.
  1283.  
  1284.           tttteeeesssstttt _e_x_p_r or [[[[ _e_x_p_r ]]]]
  1285.                Evaluate conditional expressions.  TTTTeeeesssstttt evaluates the
  1286.                expression _e_x_p_r and, if its value is true, returns a
  1287.                zero (true) exit status; otherwise, a non-zero (false)
  1288.                exit status is returned; tttteeeesssstttt also returns a non-zero
  1289.                exit status if there are no arguments.  The following
  1290.                primitives are used to construct eeeexxxxpppprrrr:
  1291.  
  1292.                ----rrrr _f_i_l_e     true if _f_i_l_e exists and is readable.
  1293.  
  1294.                ----wwww _f_i_l_e     true if _f_i_l_e exists and is writable.
  1295.  
  1296.                ----xxxx _f_i_l_e     true if _f_i_l_e exists and is executable.
  1297.  
  1298.                ----ffff _f_i_l_e     true if _f_i_l_e exists and is a regular file.
  1299.  
  1300.                ----dddd _f_i_l_e     true if _f_i_l_e exists and is a directory.
  1301.  
  1302.                ----cccc _f_i_l_e     true if _f_i_l_e exists and is a character
  1303.                            special file.
  1304.  
  1305.                ----bbbb _f_i_l_e     true if _f_i_l_e exists and is a block special
  1306.                            file.
  1307.  
  1308.                ----ssss _f_i_l_e     true if _f_i_l_e exists and has a size greater
  1309.                            than zero.
  1310.  
  1311.                ----tttt [ _f_i_l_d_e_s ]
  1312.                            true if the open file whose file descriptor
  1313.                            number is _f_i_l_d_e_s (1 by default) is
  1314.  
  1315.  
  1316.  
  1317.      Page 20                                         (printed 11/6/90)
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1325.  
  1326.  
  1327.  
  1328.                            associated with a terminal device.
  1329.  
  1330.                ----zzzz _s_1       true if the length of the string _s_1 is
  1331.                            zero.
  1332.  
  1333.                ----nnnn _s_1       true if the length of the string _s_1 is
  1334.                            non-zero.
  1335.  
  1336.                _s_1 ==== _s_2     true if strings _s_1 and _s_2 are identical.
  1337.  
  1338.                _s_1 !!!!==== _s_2    true if strings _s_1 and _s_2 are _n_o_t
  1339.                            identical.
  1340.  
  1341.                _s_1          true if _s_1 is _n_o_t the null string.
  1342.  
  1343.                _n_1 ----eeeeqqqq _n_2   true if the integers _n_1 and _n_2 are
  1344.                            algebraically equal.  Any of the
  1345.                            comparisons ----nnnneeee, ----ggggtttt, ----ggggeeee, ----lllltttt, and ----lllleeee may
  1346.                            be used in place of RRRR----eeeeqqqq.
  1347.  
  1348.                These primaries may be combined with the following
  1349.                operators:
  1350.  
  1351.                !!!!           unary negation operator.
  1352.  
  1353.                ----aaaa          binary _a_n_d operator.
  1354.  
  1355.                ----oooo          binary _o_r operator (----aaaa has higher
  1356.                            precedence than ----oooo).
  1357.  
  1358.                (((( expr ))))    parentheses for grouping.
  1359.  
  1360.                Notice that all the operators and flags are separate
  1361.                arguments to tttteeeesssstttt.  Notice also that parentheses are
  1362.                meaningful to the shell and, therefore, must be
  1363.                escaped.
  1364.  
  1365.           ttttrrrraaaapppp [ _a_r_g ] [ _n ] ...
  1366.                The command _a_r_g is to be read and executed when the
  1367.                shell receives signal(s) _n.  (Note that _a_r_g is scanned
  1368.                once when the trap is set and once when the trap is
  1369.                taken.) Trap commands are executed in order of signal
  1370.                number.  Any attempt to set a trap on a signal that was
  1371.                ignored on entry to the current shell is ineffective.
  1372.                An attempt to trap on signal 11 (memory fault) produces
  1373.                an error.  If _a_r_g is absent all trap(s) _n are reset to
  1374.                their original values.  If _a_r_g is the null string this
  1375.                signal is ignored by the shell and by the commands it
  1376.                invokes.  If _n is 0 the command _a_r_g is executed on exit
  1377.                from the shell.  The ttttrrrraaaapppp command with no arguments
  1378.                prints a list of commands associated with each signal
  1379.                number.
  1380.  
  1381.  
  1382.  
  1383.      Page 21                                         (printed 11/6/90)
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1391.  
  1392.  
  1393.  
  1394.           ttttyyyyppppeeee [ _n_a_m_e ... ]
  1395.                For each _n_a_m_e, indicate how it would be interpreted if
  1396.                used as a command name.
  1397.  
  1398.           uuuummmmaaaasssskkkk [ _n_n_n ]
  1399.                The user file-creation mask is set to _n_n_n (see
  1400.                _u_m_a_s_k(2)).  If _n_n_n is omitted, the current value of the
  1401.                mask is printed.
  1402.  
  1403.           uuuunnnnsssseeeetttt [ _n_a_m_e ... ]
  1404.                For each _n_a_m_e, remove the corresponding variable or
  1405.                function.  The variables PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, and IIIIFFFFSSSS cannot
  1406.                be unset.
  1407.  
  1408.           vvvveeeerrrr  Display the current version of the shell.
  1409.  
  1410.         IIIInnnnvvvvooooccccaaaattttiiiioooonnnn
  1411.           If the shell is invoked through _e_x_e_c(2) and the first
  1412.           character of argument zero is ---- or the ----0000(zero) switch is in
  1413.           the invokation line, commands are initially read from
  1414.           ////eeeettttcccc////pppprrrrooooffffiiiilllleeee....sssshhhh and from $$$$HHHHOOOOMMMMEEEE////pppprrrrooooffffiiiilllleeee....sssshhhh, if such files
  1415.           exist.  Thereafter, commands are read as described below,
  1416.           which is also the case when the shell is invoked as ////bbbbiiiinnnn////sssshhhh.
  1417.           The flags below are interpreted by the shell on invocation
  1418.           only; Note that unless the ----cccc or ----ssss flag is specified, the
  1419.           first argument is assumed to be the name of a file
  1420.           containing commands, and the remaining arguments are passed
  1421.           as positional parameters to that command file:
  1422.  
  1423.           ----cccc string If the ----cccc flag is present commands are read from
  1424.                     _s_t_r_i_n_g.
  1425.           ----ssss        If the ----ssss flag is present or if no arguments
  1426.                     remain commands are read from the standard input.
  1427.                     Any remaining arguments specify the positional
  1428.                     parameters.  Shell output (except for _S_p_e_c_i_a_l
  1429.                     _C_o_m_m_a_n_d_s) is written to file descriptor 2.
  1430.           ----iiii        If the ----iiii flag is present or if the shell input
  1431.                     and output are attached to a terminal, this shell
  1432.                     is _i_n_t_e_r_a_c_t_i_v_e.  In this case, the TERMINATE
  1433.                     signal is ignored and the INTERRUPT signal is
  1434.                     caught and ignored.  In all cases, the QUIT signal
  1435.                     is ignored by the shell.
  1436.           ----rrrr        If the ----rrrr flag is present, the shell is a
  1437.                     restricted shell.
  1438.           ----0000(zero)  If the ----0000(zero) flag is present, this has the same
  1439.                     effect as starting the shell with the first
  1440.                     character of argument zero as a ---- (see above).
  1441.  
  1442.           The remaining flags and arguments are described under the
  1443.           sssseeeetttt command above.
  1444.  
  1445.         RRRRsssshhhh OOOOnnnnllllyyyy
  1446.  
  1447.  
  1448.  
  1449.      PPPPaaaaggggeeee 22222222                                         ((((pppprrrriiiinnnntttteeeedddd 11111111////6666////99990000))))
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1457.  
  1458.  
  1459.  
  1460.           _R_s_h is used to set up login names and execution environments
  1461.           whose capabilities are more controlled than those of the
  1462.           standard shell.  The actions of _r_s_h are identical to those
  1463.           of _s_h, except that the following are disallowed:
  1464.                changing directory (see _c_d(1)),
  1465.                setting the value of $$$$PPPPAAAATTTTHHHH
  1466.                specifying path or command names containing ////,
  1467.                redirecting output (>>>> and >>>>>>>>).
  1468.  
  1469.           The restrictions above are enforced after pppprrrrooooffffiiiilllleeee....sssshhhh is
  1470.           interpreted.
  1471.  
  1472.           When a command to be executed is found to be a shell
  1473.           procedure, _r_s_h invokes _s_h to execute it.  Thus, it is
  1474.           possible to provide to the end-user shell procedures that
  1475.           have access to the full power of the standard shell, while
  1476.           imposing a limited menu of commands; this scheme assumes
  1477.           that the end-user does not have write and execute
  1478.           permissions in the same directory.
  1479.  
  1480.           The net effect of these rules is that the writer of the
  1481.           pppprrrrooooffffiiiilllleeee....sssshhhh has complete control over user actions, by
  1482.           performing guaranteed setup actions and leaving the user in
  1483.           an appropriate directory (probably _n_o_t the login directory).
  1484.  
  1485.           The system administrator often sets up a directory of
  1486.           commands (i.e., ////uuuussssrrrr////rrrrbbbbiiiinnnn) that can be safely invoked by
  1487.           _r_s_h.  Some systems also provide a restricted editor _r_e_d.
  1488.  
  1489.      EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS
  1490.           Errors detected by the shell, such as syntax errors, cause
  1491.           the shell to return a non-zero exit status.  If the shell is
  1492.           being used non-interactively execution of the shell file is
  1493.           abandoned.  Otherwise, the shell returns the exit status of
  1494.           the last command executed (see also the eeeexxxxiiiitttt command above).
  1495.  
  1496.      FFFFIIIILLLLEEEESSSS
  1497.           /etc/profile.sh
  1498.           $HOME/profile.sh
  1499.           $TMP/sh*
  1500.           ??/sh.ini
  1501.  
  1502.      CCCCRRRRIIIITTTTIIIICCCCAAAALLLL EEEERRRRRRRROOOORRRRSSSS
  1503.           The Shell provide a Critical Error Handler (Interrupt 24)
  1504.           similar to the standard MSDOS handler.  In addition to the
  1505.           standard message, the handler also displays the Extended
  1506.           Error Code information in hexadecimal.
  1507.  
  1508.      LLLLIIIIMMMMIIIIIIIITTTTAAAATTTTIIIIOOOONNNNSSSS
  1509.           Any TSR (Terminate Stay Resident) programs must be loaded
  1510.           before loading _S_h as the shell will overwrite the TSR when
  1511.           it reloads itself after swapping out.
  1512.  
  1513.  
  1514.  
  1515.      Page 23                                         (printed 11/6/90)
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.      SSSSHHHH((((1111LLLL))))       MMMMSSSS----DDDDOOOOSSSS VVVVeeeerrrrssssiiiioooonnnn 1111....6666 ((((DDDDaaaattttaaaa LLLLooooggggiiiicccc LLLLiiiimmmmiiiitttteeeedddd))))       SSSSHHHH((((1111LLLL))))
  1523.  
  1524.  
  1525.  
  1526.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1527.           cd(1), env(1), test(1), umask(1).
  1528.           dup(2), exec(2), pipe(2), signal(2), umask(2), wait(2),
  1529.           strtol(3), profile(4), environ(5) in the _U_N_I_X _S_y_s_t_e_m
  1530.           _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.
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.      Page 24                                         (printed 11/6/90)
  1582.  
  1583.  
  1584.  
  1585.