


      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



      NNNNAAAAMMMMEEEE
           sh, rshell - shell, the standard/restricted command
           programming language

      SSSSYYYYNNNNTTTTAAAAXXXX
           sssshhhh [ ----aaaacccceeeeffffhhhhiiiikkkknnnnrrrrssssttttuuuuvvvvxxxx ] [ args ]
           rrrrsssshhhheeeellllllll [ ----aaaacccceeeeffffhhhhiiiikkkknnnnrrrrssssttttuuuuvvvvxxxx ] [ args ]

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _S_h is a command programming language that executes commands
           read from a terminal or a file.  _R_s_h_e_l_l is a restricted
           version of the standard command interpreter _s_h; it is used
           to set up login names and execution environments whose
           capabilities are more controlled than those of the standard
           shell.  See _I_n_v_o_c_a_t_i_o_n below for the meaning of arguments to
           the shell.

         DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss
           A _b_l_a_n_k is a tab or a space.  A _n_a_m_e is a sequence of
           letters, digits, or underscores beginning with a letter or
           underscore.  A _p_a_r_a_m_e_t_e_r is a name, a digit, or any of the
           characters ****, @@@@, ####, ????, ----, $$$$, and !!!!.

         CCCCoooommmmmmmmaaaannnnddddssss
           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.  The first word specifies the name of the command
           to be executed.  Except as specified below, the remaining
           words are passed as arguments to the invoked command.  The
           command name is passed as argument 0 (see _e_x_e_c(2)).  The
           _v_a_l_u_e of a simple-command is its exit status if it
           terminates normally, or (octal) 200+_s_t_a_t_u_s if it terminates
           abnormally (see _s_i_g_n_a_l(2) for a list of status values).

           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, for historical compatibility, by ^^^^).  The standard
           output of each command but the last is connected by a
           _p_i_p_e(2) to the standard input of the next command.  Each
           command is run as a separate process; the shell waits for
           the last command to terminate.  The exit status of a
           pipeline is the exit status of the last command.

           A _l_i_s_t is a sequence of one or more pipelines separated by
           ;;;;, &&&&, &&&&&&&&, or ||||||||, and optionally terminated by ;;;; or &&&&.  Of
           these four symbols, ;;;; and &&&& have equal precedence, which is
           lower than that of &&&&&&&& and ||||||||.  The symbols &&&&&&&& and |||||||| also
           have equal precedence.  A semicolon (;;;;) causes sequential
           execution of the preceding pipeline; an ampersand (&&&&) causes
           asynchronous execution of the preceding pipeline (i.e., the
           shell does _n_o_t wait for that pipeline to finish).  The
           symbol &&&&&&&& (||||||||) causes the _l_i_s_t following it to be executed
           only if the preceding pipeline returns a zero (non-zero)
           exit status.  An arbitrary number of new-lines may appear in



      Page 1                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           a _l_i_s_t, instead of semicolons, to delimit commands.

           A _c_o_m_m_a_n_d is either a simple-command or one of the
           following.  Unless otherwise stated, the value returned by a
           command is that of the last simple-command executed in the
           command.

           ffffoooorrrr _n_a_m_e [ iiiinnnn _w_o_r_d ... ] ddddoooo _l_i_s_t ddddoooonnnneeee
                Each time a ffffoooorrrr command is executed, _n_a_m_e is set to the
                next _w_o_r_d taken from the iiiinnnn _w_o_r_d list.  If iiiinnnn _w_o_r_d ...
                is omitted, then the ffffoooorrrr command executes the ddddoooo _l_i_s_t
                once for each positional 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).  Execution ends when
                there are no more words in the list.
           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
                A ccccaaaasssseeee command executes the _l_i_s_t associated with the
                first _p_a_t_t_e_r_n that matches _w_o_r_d.  The form of the
                patterns is the same 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) except that a
                slash, a leading dot, or a dot immediately following a
                slash need not be matched explicitly.
           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
                The _l_i_s_t following iiiiffff is executed and, if it returns a
                zero exit status, the _l_i_s_t following the first tttthhhheeeennnn is
                executed.  Otherwise, the _l_i_s_t following eeeelllliiiiffff is
                executed and, if its value is zero, the _l_i_s_t following
                the next tttthhhheeeennnn is executed.  Failing that, the eeeellllsssseeee _l_i_s_t
                is executed.  If no eeeellllsssseeee _l_i_s_t or tttthhhheeeennnn _l_i_s_t is executed,
                then the iiiiffff command returns a zero exit status.
           wwwwhhhhiiiilllleeee _l_i_s_t ddddoooo _l_i_s_t ddddoooonnnneeee
                A wwwwhhhhiiiilllleeee command repeatedly executes the wwwwhhhhiiiilllleeee _l_i_s_t and,
                if the exit status of the last command in the list is
                zero, executes the ddddoooo _l_i_s_t; otherwise the loop
                terminates.  If no commands in the ddddoooo _l_i_s_t are
                executed, then the wwwwhhhhiiiilllleeee command returns a zero exit
                status; uuuunnnnttttiiiillll may be used in place of wwwwhhhhiiiilllleeee to negate
                the loop termination test.
           ((((_l_i_s_t))))
                Execute _l_i_s_t in a sub-shell.
           {{{{_l_i_s_t;;;;}}}}
                _l_i_s_t is simply executed.
           _n_a_m_e (((()))) {{{{_l_i_s_t;;;;}}}}
                Define a function which is referenced by _n_a_m_e. The body
                of the function is the _l_i_s_t of commands between {{{{ and
                }}}}.  Execution of functions is described below (see
                _E_x_e_c_u_t_i_o_n).

           The following words are only recognized as the first word of
           a command and when not quoted:

           iiiiffff tttthhhheeeennnn eeeellllsssseeee eeeelllliiiiffff ffffiiii ccccaaaasssseeee eeeessssaaaacccc ffffoooorrrr wwwwhhhhiiiilllleeee uuuunnnnttttiiiillll ddddoooo ddddoooonnnneeee {{{{ }}}}




      Page 2                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



         CCCCoooommmmmmmmeeeennnnttttssss
           A word beginning with #### causes that word and all the
           following characters up to a new-line to be ignored.

         CCCCoooommmmmmmmaaaannnndddd SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
           The standard output from a command enclosed in a pair of
           grave accents (````````) may be used as part or all of a word;
           trailing new-lines are removed.

         PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn
           The character $$$$ is used to introduce substitutable
           _p_a_r_a_m_e_t_e_r_s.  There are two types of parameters, positional
           and keyword.  If _p_a_r_a_m_e_t_e_r is a digit, it is a positional
           parameter.  Positional parameters may be assigned values by
           sssseeeetttt.  Keyword parameters (also known as variables) may be
           assigned values by writing:

                _n_a_m_e====_v_a_l_u_e [ _n_a_m_e====_v_a_l_u_e ] ...

           Pattern-matching is not performed on _v_a_l_u_e.  There cannot be
           a function and a variable with the same _n_a_m_e.

           $$$${{{{_p_a_r_a_m_e_t_e_r}}}}
                The value, if any, of the parameter is substituted.
                The braces are required only when _p_a_r_a_m_e_t_e_r is followed
                by a letter, digit, or underscore that is not to be
                interpreted as part of its name.  If _p_a_r_a_m_e_t_e_r is **** or
                @@@@, all the positional parameters, starting with $$$$1111, are
                substituted (separated by spaces).  Parameter $$$$0000 is set
                from argument zero when the shell is invoked.
           $$$${{{{_p_a_r_a_m_e_t_e_r::::----_w_o_r_d}}}}
                If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
                value; otherwise substitute _w_o_r_d.
           $$$${{{{_p_a_r_a_m_e_t_e_r::::====_w_o_r_d}}}}
                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 the parameter is substituted.  Positional
                parameters may not be assigned to in this way.
           $$$${{{{_p_a_r_a_m_e_t_e_r::::????_w_o_r_d}}}}
                If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its
                value; otherwise, print _w_o_r_d and exit from the shell.
                If _w_o_r_d is omitted, the message ``parameter null or not
                set'' is printed.
           $$$${{{{_p_a_r_a_m_e_t_e_r::::++++_w_o_r_d}}}}
                If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute _w_o_r_d;
                otherwise substitute nothing.

           In the above, _w_o_r_d is not evaluated unless it is to be used
           as the substituted string, so that, in the following
           example, ppppwwwwdddd is executed only if dddd is not set or is null:

                echo ${d:-`pwd`}




      Page 3                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           If the colon (::::) is omitted from the above expressions, the
           shell only checks whether _p_a_r_a_m_e_t_e_r is set or not.

           The following parameters are automatically set by the shell:
                ####    The number of positional parameters in decimal.
                ----    Flags supplied to the shell on invocation or by
                     the sssseeeetttt command.
                ????    The decimal value returned by the last
                     synchronously executed command.
                $$$$    The process number of this shell.
                !!!!    The process number of the last background command
                     invoked.

           The following parameters are used by the shell:
                HHHHOOOOMMMMEEEE The default argument (home directory) for the _c_d
                     command.
                PPPPAAAATTTTHHHH The search path for commands (see _E_x_e_c_u_t_i_o_n
                     below).  The user may not change PPPPAAAATTTTHHHH if executing
                     under _r_s_h_e_l_l.
                CCCCDDDDPPPPAAAATTTTHHHH
                     The search path for the _c_d command.
                MMMMAAAAIIIILLLL If this parameter is set to the name of a mail
                     file _a_n_d the MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH parameter is not set, the
                     shell informs the user of the arrival of mail in
                     the specified file.
                MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK
                     This parameter specifies how often (in seconds)
                     the shell will check for the arrival of mail in
                     the files specified by the MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH or MMMMAAAAIIIILLLL
                     parameters.  The default value is 600 seconds (10
                     minutes).  If set to 0, the shell will check
                     before each prompt.
                MMMMAAAAIIIILLLLPPPPAAAATTTTHHHH
                     A colon (::::) separated list of file names.  If this
                     parameter is set, the shell informs the user of
                     the arrival of mail in any of the specified files.
                     Each file name can be followed by %%%% and a message
                     that will be printed when the modification time
                     changes.  The default message is _y_o_u _h_a_v_e _m_a_i_l.
                PPPPSSSS1111  Primary prompt string, by default ``$$$$ ''.
                PPPPSSSS2222  Secondary prompt string, by default ``>>>> ''.
                IIIIFFFFSSSS  Internal field separators, normally ssssppppaaaacccceeee, ttttaaaabbbb,
                     and nnnneeeewwww----lllliiiinnnneeee.
                SSSSHHHHEEEELLLLLLLL
                     When the shell is invoked, it scans the
                     environment (see _E_n_v_i_r_o_n_m_e_n_t below) for this name.
                     If it is found and there is an 'r' in the file
                     name part of its value, the shell becomes a
                     restricted shell.

           The shell gives default values to PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK
           and IIIIFFFFSSSS.  HHHHOOOOMMMMEEEE and MMMMAAAAIIIILLLL are set by _l_o_g_i_n(1).



      Page 4                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



         BBBBllllaaaannnnkkkk IIIInnnntttteeeerrrrpppprrrreeeettttaaaattttiiiioooonnnn
           After parameter and command substitution, the results of
           substitution are scanned for internal field separator
           characters (those found in IIIIFFFFSSSS) and split into distinct
           arguments where such characters are found.  Explicit null
           arguments ("""""""" or '''''''') are retained.  Implicit null arguments
           (those resulting from _p_a_r_a_m_e_t_e_r_s that have no values) are
           removed.

         FFFFiiiilllleeee NNNNaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn
           Following substitution, each command _w_o_r_d is scanned for the
           characters ****, ????, and [[[[.  If one of these characters appears
           the word is regarded as a _p_a_t_t_e_r_n.  The word is replaced
           with alphabetically sorted file names that match the
           pattern.  If no file name is found that matches the pattern,
           the word is left unchanged.  The character .... at the start of
           a file name or immediately following a ////, as well as the
           character //// itself, must be matched explicitly.

                ****    Matches any string, including the null string.
                ????    Matches any single character.
                [[[[...]]]]
                     Matches any one of the enclosed characters.  A
                     pair of characters separated by ---- matches any
                     character lexically between the pair, inclusive.
                     If the first character following the opening ``[''
                     is a ````````!!!!'''''''' any character not enclosed is matched.

         QQQQuuuuoooottttiiiinnnngggg
           The following characters have a special meaning to the shell
           and cause termination of a word unless quoted:

                ;;;;  &&&&  ((((  ))))  ||||  ^^^^  <<<<  >>>>  nnnneeeewwww----lllliiiinnnneeee  ssssppppaaaacccceeee  ttttaaaabbbb

           A character may be _q_u_o_t_e_d (i.e., made to stand for itself)
           by preceding it with a \\\\.  The pair \\\\nnnneeeewwww----lllliiiinnnneeee is ignored.
           All characters enclosed between a pair of single quote marks
           (''''''''), except a single quote, are quoted.  Inside double
           quote marks (""""""""), parameter and command substitution occurs
           and \\\\ quotes the characters \\\\, ````, """", and $$$$.  """"$$$$****"""" is
           equivalent to """"$$$$1111 $$$$2222 ..."""", whereas """"$$$$@@@@"""" is equivalent to
           """"$$$$1111"""" """"$$$$2222"""" ....

         PPPPrrrroooommmmppppttttiiiinnnngggg
           When used interactively, the shell prompts with the value of
           PPPPSSSS1111 before reading a command.  If at any time a new-line is
           typed and further input is needed to complete a command, the
           secondary prompt (i.e., the value of PPPPSSSS2222) is issued.

         IIIInnnnppppuuuutttt////OOOOuuuuttttppppuuuutttt
           Before a command is executed, its input and output may be
           redirected using a special notation interpreted by the



      Page 5                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           shell.  The following may appear anywhere in a simple-
           command or may precede or follow a _c_o_m_m_a_n_d and are _n_o_t
           passed on to the invoked command; substitution occurs before
           _w_o_r_d or _d_i_g_i_t is used:

           <<<<wwwwoooorrrrdddd         Use file _w_o_r_d as standard input (file
                         descriptor 0).
           >>>>wwwwoooorrrrdddd         Use file _w_o_r_d as standard output (file
                         descriptor 1).  If the file does not exist it
                         is created; otherwise, it is truncated to zero
                         length.
           >>>>>>>>wwwwoooorrrrdddd        Use file _w_o_r_d as standard output.  If the file
                         exists output is appended to it (by first
                         seeking to the end-of-file); otherwise, the
                         file is created.
           <<<<<<<<[----]wwwwoooorrrrdddd     The shell input is read up to a line that is
                         the same as _w_o_r_d, or to an end-of-file.  The
                         resulting document becomes the standard input.
                         If any character of _w_o_r_d is quoted, no
                         interpretation is placed upon the characters
                         of the document; otherwise, parameter and
                         command substitution occurs, (unescaped)
                         \\\\nnnneeeewwww----lllliiiinnnneeee is ignored, and \\\\ must be used to
                         quote the characters \\\\, $$$$, ````, and the first
                         character of _w_o_r_d.  If ---- is appended to <<<<<<<<,
                         all leading tabs are stripped from _w_o_r_d and
                         from the document.
           <<<<&&&&ddddiiiiggggiiiitttt       Use the file associated with file descriptor
                         _d_i_g_i_t as standard input.  Similarly for the
                         standard output using >>>>&&&&ddddiiiiggggiiiitttt.
           <<<<&&&&----           The standard input is closed.  Similarly for
                         the standard output using >>>>&&&&----.

           If any of the above is preceded by a digit, the file
           descriptor which will be associated with the file is that
           specified by the digit (instead of the default 0 or 1).  For
           example:

                ... 2>&1

           associates file descriptor 2 with the file currently
           associated with file descriptor 1.

           The order in which redirections are specified is
           significant.  The shell evaluates redirections left-to-
           right.  For example:

                ... 1>_x_x_x 2>&1

           first associates file descriptor 1 with file _x_x_x.  It
           associates file descriptor 2 with the file associated with
           file descriptor 1 (i.e. _x_x_x).  If the order of redirections



      Page 6                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           were reversed, file descriptor 2 would be associated with
           the terminal (assuming file descriptor 1 had been) and file
           descriptor 1 would be associated with file _x_x_x.

           If a command is followed by &&&& the default standard input for
           the command is the empty file ////ddddeeeevvvv////nnnnuuuullllllll.  Otherwise, the
           environment for the execution of a command contains the file
           descriptors of the invoking shell as modified by
           input/output specifications.

           Redirection of output is not allowed in the restricted
           shell.

         EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt
           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 passed to an executed program in the same way
           as a normal argument list.  The shell interacts with the
           environment in several ways.  On invocation, the shell scans
           the environment and creates a parameter for each name found,
           giving it the corresponding value.  If the user modifies the
           value of any of these parameters or creates new parameters,
           none of these affects the environment unless the eeeexxxxppppoooorrrrtttt
           command is used to bind the shell's parameter to the
           environment (see also sssseeeetttt ----aaaa).  A parameter may be removed
           from the environment with the uuuunnnnsssseeeettttcommand.  The environment
           seen by any executed command is thus composed of any
           unmodified name-value pairs originally inherited by the
           shell, minus any pairs removed by uuuunnnnsssseeeetttt, plus any
           modifications or additions, all of which must be noted in
           eeeexxxxppppoooorrrrtttt commands.

           The environment for any _s_i_m_p_l_e-_c_o_m_m_a_n_d may be augmented by
           prefixing it with one or more assignments to parameters.
           Thus:

                TERM=450 cmd                  and
                (export TERM; TERM=450; cmd)

           are equivalent (as far as the execution of _c_m_d is
           concerned).

           If the ----kkkk flag is set, _a_l_l keyword arguments are placed in
           the environment, even if they occur after the command name.
           The following first prints aaaa====bbbb cccc and cccc:

                echo a=b c
                set -k
                echo a=b c

         SSSSiiiiggggnnnnaaaallllssss
           The INTERRUPT and QUIT signals for an invoked command are
           ignored if the command is followed by &&&&; otherwise signals



      Page 7                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           have the values inherited by the shell from its parent, with
           the exception of signal 11 (but see also the ttttrrrraaaapppp command
           below).

         EEEExxxxeeeeccccuuuuttttiiiioooonnnn
           Each time a command is executed, the above substitutions are
           carried 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 below, it is executed in the shell process.
           If the command name does not match a _S_p_e_c_i_a_l _C_o_m_m_a_n_d, but
           matches the name of a defined function, the function is
           executed in the shell process (note how this differs from
           the execution of shell procedures).  The positional
           parameters $$$$1111, $$$$2222, ....  are set to the arguments of the
           function.  If 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 defined function, a new process is
           created and an attempt is made to execute the command via
           _e_x_e_c(2).

           The shell parameter PPPPAAAATTTTHHHH defines the search path for the
           directory containing the command.  Alternative directory
           names are separated by a colon (::::).  The default path is
           ::::////bbbbiiiinnnn::::////uuuussssrrrr////bbbbiiiinnnn (specifying the current directory, ////bbbbiiiinnnn, and
           ////uuuussssrrrr////bbbbiiiinnnn, in that order).  Note that the current directory
           is specified by a null path name, which can appear
           immediately after the equal sign or between the colon
           delimiters anywhere else in the path list.  If the command
           name contains a //// the search path is not used; such commands
           will not be executed by the restricted shell.  Otherwise,
           each directory in the path is searched for an executable
           file.  If the file has execute permission but is not an
           aaaa....oooouuuutttt file, it is assumed to be a file containing shell
           commands.  A sub-shell is spawned to read it.  A
           parenthesized command is also executed in a sub-shell.

           The location in the search path where a command was found is
           remembered by the shell (to help avoid unnecessary _e_x_e_c_s
           later).  If the command was found in a relative directory,
           its location must be re-determined whenever the current
           directory changes.  The shell forgets all remembered
           locations whenever the PPPPAAAATTTTHHHH variable is changed or the hhhhaaaasssshhhh
           ----rrrr command is executed (see below).

         SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss
           Input/output redirection is now permitted for these
           commands.  File descriptor 1 is the default output location.

           ::::    No effect; the command does nothing.  A zero exit code
                is returned.
           .... _f_i_l_e
                Read and execute commands from _f_i_l_e and return.  The
                search path specified by PPPPAAAATTTTHHHH is used to find the
                directory containing _f_i_l_e.



      Page 8                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           bbbbrrrreeeeaaaakkkk [ _n ]
                Exit from the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee loop, if any.  If
                _n is specified break _n levels.
           ccccoooonnnnttttiiiinnnnuuuueeee [ _n ]
                Resume the next iteration of the enclosing ffffoooorrrr or wwwwhhhhiiiilllleeee
                loop.  If _n is specified resume at the _n-th enclosing
                loop.
           ccccdddd [ _a_r_g ]
                Change the current directory to _a_r_g.  The shell
                parameter HHHHOOOOMMMMEEEE is the default _a_r_g.  The shell parameter
                CCCCDDDDPPPPAAAATTTTHHHH defines the search path for the directory
                containing _a_r_g.  Alternative directory names are
                separated by a colon (::::).  The default path is <<<<nnnnuuuullllllll>>>>
                (specifying the current directory).  Note that the
                current directory is specified by a null path name,
                which can appear immediately after the equal sign or
                between the colon delimiters anywhere else in the path
                list.  If _a_r_g begins with a //// the search path is not
                used.  Otherwise, each directory in the path is
                searched for _a_r_g.  The _c_d command may not be executed
                by _r_s_h_e_l_l.
           eeeecccchhhhoooo [ _a_r_g ... ]
                Echo arguments. See _e_c_h_o(1) for usage and description.
           eeeevvvvaaaallll [ _a_r_g ... ]
                The arguments are read as input to the shell and the
                resulting command(s) executed.
           eeeexxxxeeeecccc [ _a_r_g ... ]
                The command specified by the arguments is executed in
                place of this shell without creating a new process.
                Input/output arguments may appear and, if no other
                arguments are given, cause the shell input/output to be
                modified.
           eeeexxxxiiiitttt [ _n ]
                Causes a shell to exit with the exit status specified
                by _n.  If _n is omitted the exit status is that of the
                last command executed (an end-of-file will also cause
                the shell to exit.)
           eeeexxxxppppoooorrrrtttt [ _n_a_m_e ... ]
                The given _n_a_m_es are marked for automatic export to the
                _e_n_v_i_r_o_n_m_e_n_t of subsequently-executed commands.  If no
                arguments are given, a list of all names that are
                exported in this shell is printed.  Function names may
                _n_o_t be exported.
           hhhhaaaasssshhhh [ ----rrrr ] [ _n_a_m_e ... ]
                For each _n_a_m_e, the location in the search path of the
                command specified by _n_a_m_e is determined and remembered
                by the shell.  The ----rrrr option causes the shell to forget
                all remembered locations.  If no arguments are given,
                information about remembered commands is presented.
                _H_i_t_s is the number of times a command has been invoked
                by the shell process.  _C_o_s_t is a measure of the work
                required to locate a command in the search path.  There



      Page 9                                                   (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



                are certain situations which require that the stored
                location of a command be recalculated.  Commands for
                which this will be done are indicated by an asterisk
                (****) adjacent to the _h_i_t_s information.  _C_o_s_t will be
                incremented when the recalculation is done.
           nnnneeeewwwwggggrrrrpppp [ _a_r_g ... ]
                Equivalent to eeeexxxxeeeecccc nnnneeeewwwwggggrrrrpppp _a_r_g ....  See _n_e_w_g_r_p(1) for
                usage and description.
           ppppwwwwdddd  Print the current working directory.  See _p_w_d(1) for
                usage and description.
           rrrreeeeaaaadddd [ _n_a_m_e ... ]
                One line is read from the standard input and the first
                word is assigned to the first _n_a_m_e, the second word to
                the second _n_a_m_e, etc., with leftover words assigned to
                the last _n_a_m_e.  The return code is 0 unless an end-of-
                file is encountered.
           rrrreeeeaaaaddddoooonnnnllllyyyy [ _n_a_m_e ... ]
                The given _n_a_m_es are marked _r_e_a_d_o_n_l_y and the values of
                the these _n_a_m_es may not be changed by subsequent
                assignment.  If no arguments are given, a list of all
                _r_e_a_d_o_n_l_y names is printed.
           rrrreeeettttuuuurrrrnnnn [ _n ]
                Causes a function to exit with the return value
                specified by _n.  If _n is omitted, the return status is
                that of the last command executed.
           sssseeeetttt [ --------aaaaeeeeffffhhhhkkkknnnnttttuuuuvvvvxxxx [ _a_r_g ... ] ]
                ----aaaa   Mark variables which are modified or created for
                     export.
                ----eeee   Exit immediately if a command exits with a non-
                     zero exit status.
                ----ffff   Disable file name generation
                ----hhhh   Locate and remember function commands as functions
                     are defined (function commands are normally
                     located when the function is executed).
                ----kkkk   All keyword arguments are placed in the
                     environment for a command, not just those that
                     precede the command name.
                ----nnnn   Read commands but do not execute them.
                ----tttt   Exit after reading and executing one command.
                ----uuuu   Treat unset variables as an error when
                     substituting.
                ----vvvv   Print shell input lines as they are read.
                ----xxxx   Print commands and their arguments as they are
                     executed.
                --------   Do not change any of the flags; useful in setting
                     $$$$1111 to ----.
                Using ++++ rather than ---- causes these flags to be turned
                off.  These flags can also be used upon invocation of
                the shell.  The current set of flags may be found in
                $$$$----.  The remaining arguments are positional parameters
                and are assigned, in order, to $$$$1111, $$$$2222, ....  If no
                arguments are given the values of all names are



      Page 10                                                  (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



                printed.
           sssshhhhiiiifffftttt [ _n ]
                The positional parameters from $$$$nnnn++++1111 ...  are renamed $$$$1111
                ....  If _n is not given, it is assumed to be 1.
           tttteeeesssstttt
                Evaluate conditional expressions. See _t_e_s_t(1) for usage
                and description.
           ttttiiiimmmmeeeessss
                Print the accumulated user and system times for
                processes run from the shell.
           ttttrrrraaaapppp [ _a_r_g ] [ _n ] ...
                The command _a_r_g is to be read and executed when the
                shell receives signal(s) _n.  (Note that _a_r_g is scanned
                once when the trap is set and once when the trap is
                taken.) Trap commands are executed in order of signal
                number.  Any attempt to set a trap on a signal that was
                ignored on entry to the current shell is ineffective.
                An attempt to trap on signal 11 (memory fault) produces
                an error.  If _a_r_g is absent all trap(s) _n are reset to
                their original values.  If _a_r_g is the null string this
                signal is ignored by the shell and by the commands it
                invokes.  If _n is 0 the command _a_r_g is executed on exit
                from the shell.  The ttttrrrraaaapppp command with no arguments
                prints a list of commands associated with each signal
                number.
           ttttyyyyppppeeee [ _n_a_m_e ... ]
                For each _n_a_m_e, indicate how it would be interpreted if
                used as a command name.
           uuuulllliiiimmmmiiiitttt [ ----ffffpppp ] [ _n ]
                imposes a size limit of _n
                ----ffff   imposes a size limit of _n blocks on files written
                     by child processes (files of any size may be
                     read).  With no argument, the current limit is
                     printed.
                ----pppp   changes the pipe size to _n (UNIX/RT only).
                If no option is given, ----ffff is assumed.
           uuuummmmaaaasssskkkk [ _n_n_n ]
                The user file-creation mask is set to _n_n_n (see
                _u_m_a_s_k(2)).  If _n_n_n is omitted, the current value of the
                mask is printed.
           uuuunnnnsssseeeetttt [ _n_a_m_e ... ]
                For each _n_a_m_e, remove the corresponding variable or
                function.  The variables PPPPAAAATTTTHHHH, PPPPSSSS1111, PPPPSSSS2222, MMMMAAAAIIIILLLLCCCCHHHHEEEECCCCKKKK and
                IIIIFFFFSSSS cannot be unset.
           wwwwaaaaiiiitttt [ _n ]
                Wait for the specified process and report its
                termination status.  If _n is not given all currently
                active child processes are waited for and the return
                code is zero.

         IIIInnnnvvvvooooccccaaaattttiiiioooonnnn
           If the shell is invoked through _e_x_e_c(2) and the first



      Page 11                                                  (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           character of argument zero is ----, commands are initially read
           from ////eeeettttcccc////pppprrrrooooffffiiiilllleeee and from $$$$HHHHOOOOMMMMEEEE////....pppprrrrooooffffiiiilllleeee, if such files
           exist.  Thereafter, commands are read as described below,
           which is also the case when the shell is invoked as ////bbbbiiiinnnn////sssshhhh.
           The flags below are interpreted by the shell on invocation
           only; Note that unless the ----cccc or ----ssss flag is specified, the
           first argument is assumed to be the name of a file
           containing commands, and the remaining arguments are passed
           as positional parameters to that command file:

           ----cccc _s_t_r_i_n_g If the ----cccc flag is present commands are read from
                     _s_t_r_i_n_g.
           ----ssss        If the ----ssss flag is present or if no arguments
                     remain commands are read from the standard input.
                     Any remaining arguments specify the positional
                     parameters.  Shell output (except for _S_p_e_c_i_a_l
                     _C_o_m_m_a_n_d_s) is written to file descriptor 2.
           ----iiii        If the ----iiii flag is present or if the shell input
                     and output are attached to a terminal, this shell
                     is _i_n_t_e_r_a_c_t_i_v_e.  In this case TERMINATE is ignored
                     (so that kkkkiiiillllllll 0000 does not kill an interactive
                     shell) and INTERRUPT is caught and ignored (so
                     that wwwwaaaaiiiitttt is interruptible).  In all cases, QUIT
                     is ignored by the shell.
           ----rrrr        If the ----rrrr flag is present the shell is a
                     restricted shell.

           The remaining flags and arguments are described under the
           sssseeeetttt command above.

         RRRRsssshhhheeeellllllll OOOOnnnnllllyyyy
           _R_s_h_e_l_l is used to set up login names and execution
           environments whose capabilities are more controlled than
           those of the standard shell.  The actions of _r_s_h_e_l_l are
           identical to those of _s_h, except that the following are
           disallowed:
                changing directory (see _c_d(1)),
                setting the value of $$$$PPPPAAAATTTTHHHH,,,,
                specifying path or command names containing ////,
                redirecting output (>>>> and >>>>>>>>).

           The restrictions above are enforced after ....pppprrrrooooffffiiiilllleeee is
           interpreted.

           When a command to be executed is found to be a shell
           procedure, _r_s_h_e_l_l invokes _s_h to execute it.  Thus, it is
           possible to provide to the end-user shell procedures that
           have access to the full power of the standard shell, while
           imposing a limited menu of commands; this scheme assumes
           that the end-user does not have write and execute
           permissions in the same directory.




      Page 12                                                  (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



           The net effect of these rules is that the writer of the
           ....pppprrrrooooffffiiiilllleeee has complete control over user actions, by
           performing guaranteed setup actions and leaving the user in
           an appropriate directory (probably _n_o_t the login directory).

           The system administrator often sets up a directory of
           commands (i.e., ////uuuussssrrrr////rrrrbbbbiiiinnnn) that can be safely invoked by
           _r_s_h_e_l_l.  Some systems also provide a restricted editor _r_e_d.















































      Page 13                                                  (9010-E)






      SSSSHHHH((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      SSSSHHHH((((1111))))



      EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS
           Errors detected by the shell, such as syntax errors, cause
           the shell to return a non-zero exit status.  If the shell is
           being used non-interactively execution of the shell file is
           abandoned.  Otherwise, the shell returns the exit status of
           the last command executed (see also the eeeexxxxiiiitttt command above).

      FFFFIIIILLLLEEEESSSS
           /etc/profile
           $HOME/....profile
           /tmp/sh*
           /dev/null

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           acctcom(1), cd(1), echo(1), env(1), login(1), newgrp(1),
           pwd(1), test(1), umask(1).
           dup(2), exec(2), fork(2), pipe(2), signal(2), ulimit(2),
           umask(2), wait(2), a.out(4), profile(4), environ(5).

      CCCCAAAAVVVVEEEEAAAATTTTSSSS
           If a command is executed, and a command with the same name
           is installed in a directory in the search path before the
           directory where the original command was found, the shell
           will continue to _e_x_e_c the original command.  Use the hhhhaaaasssshhhh
           command to correct this situation.

           If you move the current directory or one above it, ppppwwwwdddd may
           not give the correct response.  Use the ccccdddd command with a
           full path name to correct this situation.


























      Page 14                                                  (9010-E)



