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 exe-
cuted 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 semi-colon (;;;;). The default path
is ....;;;;cccc::::////bbbbiiiinnnn;;;;cccc::::////uuuussssrrrr////bbbbiiiinnnn (specifying the current directory,
cccc::::////bbbbiiiinnnn, and cccc::::////uuuussssrrrr////bbbbiiiinnnn, in that order). Note that the
current directory is specified by a null path name, which
MS-DOS - OS/2 Version 2.2Last change: Data Logic Limited 31
SH(1L) MISC. REFERENCE MANUAL PAGES SH(1L)
can appear immediately after the equal sign or between the
semi-colon delimiters anywhere else in the path list. If
the command name contains a //// or starts with xxxx:::: (where x is
a drive letter) 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. Executable files are indicated by a .exe or .com
extension. This extension is automatically supplied by the
shell and not have to be entered by the user.
If the file with a .com or .exe extension cannot be found in
the directory, the file is opened and first 512 characters
are read. If there are no characters in the block with a
value in the range 0 to 7, the file is assumed to be a
script file containing shell commands. Note that the shell
will check the file and if that file does not exist or is
not a script, it will try the file with an extension of ....sssshhhh
or ....kkkksssshhhh. If a ((((ggggiiiivvvveeeennnn bbbbyyyy tttthhhheeee eeeennnnvvvviiiirrrroooonnnnmmmmeeeennnntttt vvvvaaaarrrriiiiaaaabbbblllleeee SSSSHHHHEEEELLLLLLLL) is
spawned to read it.
If the script file starts with the a line of the form #!
_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
of the shell to process the script. Optional arguments can
be supplied in the script file which are passed before the
name of the script file. Thus, if the file _d_e_m_o contained
the following string as the first line
#! perl -sP
Entering _d_e_m_o _n_a_m_e would be equivalent to entering the _p_e_r_l
-_s_P _n_a_m_e at the command prompt. Note that no other process-
ing of the first line other that the separation (by white
space) into arguments is done. Note that if the iiiinnnntttteeeerrrrpppprrrreeeetttteeeerrrr
is either /_b_i_n/_s_h or /_b_i_n/_k_s_h, the value of the SSSSHHHHEEEELLLLLLLL
environment variable is used to execute the script.
If none of the above conditions for a executable file are
detected and a file with a .bat extension exists in the
directory, the command processor given by the CCCCOOOOMMMMSSSSPPPPEEEECCCC
environment variable is spawned to process the file. This
is normally the standard MMMMSSSSDDDDOOOOSSSS _c_o_m_m_a_n_d._c_o_m or OOOOSSSS////2222 _c_m_d._e_x_e
processor.
A parenthesized command is also executed in a sub-shell.
For each _n_a_m_e specified, indicate how it would be
interpreted if used as a command name. Note that ttttyyyyppppeeee
is a shorthand for wwwwhhhheeeennnncccceeee ----vvvv.
----pppp Does a path search for _n_a_m_e even if the name is an
alias, a function, or a reserved word.
----vvvv Produces a more verbose report.
IIIInnnnvvvvooooccccaaaattttiiiioooonnnn
If the shell is invoked through _e_x_e_c(2) and the first char-
acter of argument zero is ---- or the ----0000(zero) switch is in the
invokation line, commands are initially read from
////eeeettttcccc////pppprrrrooooffffiiiilllleeee (the extensions ....sssshhhh or ....kkkksssshhhh may be used) and
from $$$$HHHHOOOOMMMMEEEE////pppprrrrooooffffiiiilllleeee (the extensions rrrreeeeaaaadddd ffffrrrroooommmm tttthhhheeee ffffiiiilllleeee nnnnaaaammmmeeeedddd