MPE/iX Shell and Utilities Reference Manual, Vol 2

sh(1) MPE/iX Shell and Utilities sh(1)
–L makes the shell a login shell as described earlier.
–r invokes a restricted shell. (As noted earlier, you can also invoke a restricted shell by
using the name rsh). In a restricted shell, you cannot do the following: use the cd
command; change the values of the variables
ENV
,
PATH
,or
SHELL
; use > or >> to
redirect output; or specify command names containing /. These restrictions do not
apply during execution of your profile files.
–s reads commands from standard input and assigns all arguments to the positional
parameters. Normally, if there is at least one argument to the shell, the first such
argument is the name of a file to execute.
If you specify cmd_file without either the –c or –s option, the shell takes it as the name of a
file which contains commands to be run. Special parameter 0 is set to this name.
In addition, you can use the –a, –b, –C, –e, –f, –h, –i, –k, –L, –m, –n, –o, –p, –r –t, –u,
–v, and –x options. The set(1) man page describes these options.
Command Syntax
The shell implements a sophisticated programming language that gives you complete control
over the execution and combination of individual commands. When the shell scans its input,
it always treats the following characters specially:
;&()<>|`\
space tab newline
If you want to use any of these characters inside an actual argument, you must quote the argu-
ment (so that the shell doesn’t use the special meanings of the characters). See Quoting for
more information.
A simple command is a list of arguments separated by blanks or tabs.
When a word begins with an unescaped hash mark (#), the remainder of the line is treated as a
comment, and the shell discards input up to but not including the next newline.
When a command starts with a defined alias, sh replaces the alias with its definition (see
alias(1)).
A reserved word command starts with a reserved word (for example, if, while, for).
Reserved word commands provide flow of control operations for the shell. These are
described later in this section.
A command may be any of the following:
command: simple command
reserved word command
(command)
command | command
Commands and Utilities 1-521