HP-UX Reference (11i v3 07/02) - 1 User Commands N-Z (vol 2)
s
sh-posix(1) sh-posix(1)
nounset Same as -u.
privileged Same as -p.
trackall Same as -h.
verbose Same as -v.
vi Use a vi-style inline editor for command entry.
viraw Process each character as it is typed in
vi mode (always on).
xtrace Same as -x.
-p Disable processing of the $HOME/.profile
file and uses the file
/etc/suid_profile
instead of the ENV file. This mode is on whenever the effective user ID (group ID) is not equal to
the real user ID (group ID). Turning this off causes the effective user ID and group ID to be set
to the real user ID and group ID.
-s Sort the positional parameters.
-t Exit after reading and executing one command.
-u Treat unset parameters as an error when substituting.
-v Print shell input lines as they are read.
-x Print commands and their arguments as they are executed.
- Turn off -x and -v options and stop examining arguments for options.
-- Do not change any of the options; useful in setting parameter 1 to a value beginning with
-.If
no arguments follow this option, the positional parameters are unset.
%
shift [n]
Rename the positional parameters from n+1 ... to 1 .... The default value of n is
1. n can be any
arithmetic expression that evaluates to a nonnegative number less than or equal to
$#.
test [expr]
Evaluate conditional expression expr. See test(1) for usage and description. See also the Conditional
Expressions subsection.
The arithmetic comparison operators are not restricted to integers. They allow any arithmetic expres-
sion. The following additional primitive expressions are allowed:
-L file True if file is a symbolic link.
-e file True if file exists.
file1 -nt file2 True if file1 is newer than file2.
file1
-ot file2 True if file1 is older than file2.
file1
-ef file2 True if file1 has the same device and i-node number as file2.
%
times
Print the accumulated user and system times for the shell and for processes run from the shell.
% trap [arg][sig]...
Set arg as a command that is read and executed when the shell receives a sig signal. (Note that arg is
scanned once when the trap is set and once when the trap is taken.) Each sig can be given as the
number or name of a signal. Letter case is ignored. For example,
3,
QUIT, quit, and SIGQUIT all
specify the same signal. Use
kill -l to get a list of signals.
Trap commands are executed in signal number order. Any attempt to set a trap on a signal that was
ignored upon entering the current shell is ineffective. Traps remain in effect for a given shell until
explicitly changed with another trap command; that is, a trap set within a function will remain in
effect even after the function returns.
If arg is - (or if arg is omitted and the first sig is numeric), reset all traps for each sig to their original
values.
If arg is the null string (’’ or ""), each sig is ignored by the shell and by the commands it invokes.
If sig is DEBUG, then arg is executed after each command. If sig is ERR, arg is executed whenever a
command has a nonzero exit code. If sig is 0 or EXIT, the command arg is executed on exit from the
shell.
With no arguments, print a list of commands associated with each signal name.
HP-UX 11i Version 3: February 2007 − 9 − Hewlett-Packard Company 251