HP-UX Reference (11i v2 04/09) - 1 User Commands N-Z (vol 2)

s
sh-posix(1) sh-posix(1)
If the first argument contains a
?, the remainder of the argument is used as a prompt when the
shell is interactive.
If the given file descriptor is open for writing and is a terminal device, the prompt is placed on that
unit. Otherwise, the prompt is issued on file descriptor 2 (standard error).
%&
readonly [name[=value] ]...
%& readonly -p
Mark the given names read only. These names cannot be changed by subsequent assignment.
With
-p, write the names and values of all read-only variables to standard output in a format with
the proper use of quoting so that it is suitable for re-input to the shell as commands that achieve the
same attribute-setting results.
%
return [n]
Cause a shell function to return to the invoking script with the return status specified by n.Ifn is
omitted, the return status is that of the last command executed. Only the low 8 bits of n (decimal 0
to 255) are passed back to the caller. If
return is invoked while not in a function or a . script (see
the
. special command), it has the same effect as an
exit command.
%
set [{-+}abCefhkmnopstuvx
][{
-+}o option]... [{-+}A name][arg]...
Set (
-) or clear (+) execution options or perform array assignments (-A
, +A). All options except -A
and +A can be supplied in a shell invocation (see the SYNOPSIS section and the Shell Invocation
subsection).
Using
+ instead of - before an option causes the option to be turned off. These options can also be
used when invoking the shell. The current list of set single-letter options is contained in the shell
variable -. It can be examined with the command echo $-.
The
- and + options can be intermixed in the same command, except that there can be only one
-A
or +A option.
Unless
-A or +A is specified, the remaining arg arguments are assigned consecutively to the posi-
tional parameters 1, 2, ....
The
set command with neither arguments nor options displays the names and values of all shell
parameters on standard output. See also env(1).
The options are defined as follows.
-A Array assignment. Unset the variable name and assign values sequentially from the list arg.
With
+A, do not unset the variable name first.
-a Automatically export subsequently defined parameters.
-b Cause the shell to notify the user asynchronously of background jobs as they are completed.
When the shell notifies the user that a job has been completed, it can remove the job’s process
ID from the list of those known in the current shell execution environment.
-C Prevent redirection > from truncating existing files. Requires >| to truncate a file when
turned on.
-e Execute the ERR trap, if set, and exit if a command has a nonzero exit status, and is not part
of the compound list following a if, until,orwhile keyword, and is not part of an AND or
OR list, and is not a pipeline preceded by the ! reserved word. This mode is disabled while
reading profiles.
-f Disable file name generation.
-h Specify that each command whose name is an identifier becomes a tracked alias when first
encountered.
-k Place all parameter assignment arguments (not just those that precede the command name)
into the environment for a command.
-m Run background jobs in a separate process group and print a line upon completion. The exit
status of background jobs is reported in a completion message. This option is turned on
automatically for interactive shells.
-n Read commands and check them for syntax errors, but do not execute them. The -n option is
ignored for interactive shells.
Section 1852 Hewlett-Packard Company 8 HP-UX 11i Version 2: September 2004