Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

User Commands (s) sh(1)
%string Any job whose command line begins with string.
%?string
Any job whose command line contains string.
%% Current job.
%+ Equivalent to %%.
%- Previous job.
This shell knows immediately whenever a process changes state. It normally informs you when-
ever a job becomes blocked so that no further progress is possible, but only just before it prints a
prompt. This is done so that it does not otherwise disturb your work.
When the monitor mode is on, each background job that is completed triggers any trap set for
CHLD.
When you try to leave the shell while jobs are stopped or running, you are warned that You
have stopped(running) jobs.
You can use the jobs command to see what they are. If you
do this or immediately try to exit again, the shell does not warn you a second time, and the
stopped jobs are terminated.
Signals
The SIGINT and SIGQUIT signals for an invoked command are ignored if the command is fol-
lowed by & and job monitor option is not active. Otherwise, signals have the values inherited
by the shell from its parent (but see also the trap command).
Execution
Each time a command is executed, the previous substitutions are carried out. If the command
name matches one of the shell built-in commands it is executed within the current shell process.
Next, the command name is checked to see if it matches one of the user-dened functions. If it
does, the positional parameters are saved and then reset to the arguments of the function call.
When the function is completed or issues a return, the positional parameter list is restored and
any trap set on EXIT within the function is executed. The value of a function is the value of the
last command executed. A function is also executed in the current shell process. If a command
name is not a special command or a user-dened function, a process is created and an attempt is
made to execute the command via exec.
The PATH shell parameter denes the search path for the directory containing the command.
Alternative directory names are separated by a : (colon). The default path is /usr/bin: (specify-
ing /usr/bin, and the current directory in that order). The current directory can be specied by
two or more adjacent colons, or by a colon at the beginning or end of the path list. If the com-
mand name contains a / (slash), then the search path is not used. Otherwise, each directory in the
path is searched for an executable le.
If the le has execute permission but is not a directory or an a.out le, it is assumed to be a le
containing shell commands. A subshell is spawned to read it. All nonexported aliases, functions,
and named parameters are removed in this case. If the shell command le does not have read
permission, or if the setuid and/or setgid bits are set on the le, the shell executes an agent
whose job it is to set up the permissions and execute the shell with the shell command le passed
down as an open le. A command in parentheses is executed in a subshell without the removal
of nonexported quantities.
527188-003 Hewlett-Packard Company 829