The following operands shall be supported:
- A single <hyphen-minus> shall be treated as the first
operand and then ignored. If both '-'
and "--"
are
given as arguments, or if other operands precede the
single <hyphen-minus>, the results are undefined.
argument The positional parameters ($1, $2, and so on) shall be
set to arguments, if any.
command_file
The pathname of a file containing commands. If the
pathname contains one or more <slash> characters, the
implementation attempts to read that file; the file
need not be executable. If the pathname does not
contain a <slash> character:
* The implementation shall attempt to read that file
from the current working directory; the file need
not be executable.
* If the file is not in the current working
directory, the implementation may perform a search
for an executable file using the value of PATH, as
described in Section 2.9.1.1, Command Search and
Execution.
Special parameter 0 (see Section 2.5.2, Special
Parameters) shall be set to the value of command_file.
If sh is called using a synopsis form that omits
command_file, special parameter 0 shall be set to the
value of the first argument passed to sh from its
parent (for example, argv[0] for a C program), which is
normally a pathname used to execute the sh utility.
command_name
A string assigned to special parameter 0 when executing
the commands in command_string. If command_name is not
specified, special parameter 0 shall be set to the
value of the first argument passed to sh from its
parent (for example, argv[0] for a C program), which is
normally a pathname used to execute the sh utility.
command_string
A string that shall be interpreted by the shell as one
or more commands, as if the string were the argument to
the system() function defined in the System Interfaces
volume of POSIX.1‐2017. If the command_string operand
is an empty string, sh shall exit with a zero exit
status.