HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)
s
sh-bourne(1) sh-bourne(1)
Recognized options are:
-a Mark variables which are modified or created for export.
-e Exit immediately if a command exits with a non-zero exit status.
-f Disable file name generation
-h Locate and remember function commands as functions are defined (function com-
mands are normally located when the function is executed).
-k All keyword arguments are placed in the environment for a command, not just
those that precede the command name.
-n Read commands but do not execute them.
-t Exit after reading and executing one command.
-u Treat unset variables as an error when substituting.
-v Print shell input lines as they are read.
-x Print commands and their arguments as they are executed.
-- Do not change any of the options; useful when $1 is to be set to a string begin-
ning with - or +.
Using + rather than - causes these options to be unset. These options can also be
used upon invocation of the shell. The current set of options can be found in $-
. The
remaining arguments are positional parameters and are assigned, in order, to
$1, $2,
... . If no arguments are given, the values of all names are printed.
shift [ n] The positional parameters from $n+1 ... are renamed $1 ... . If n is not given, it is
assumed to be 1.
test Evaluate conditional expressions. See test(1) for usage and description. Note that
[ ... ] in an if list is interpreted the same as test ... . There must be blanks
around the brackets. See also test(1).
times Print the accumulated user and system times for processes run from the shell.
trap [ arg ][n ] ... The command arg is a command to be read and executed when the shell receives
signal(s) n. (Note that arg is scanned once when the trap is set and once when the
trap is taken.) Trap commands are executed in order of signal number. Any attempt
to set a trap on a signal that was ignored on entry to the current shell is ineffective.
An attempt to trap on signal 11 (memory fault) or signal 18 (death of child) produces
an error. If arg is absent then all trap(s) n are reset to their original values. If arg is
the null string, this signal is ignored by the shell and by the commands it invokes. If
n is 0, the command arg is executed on exit from the shell. The trap command with
no arguments prints a list of commands associated with each signal number.
type [ name ... ] For each name, indicate how it would be interpreted if used as a command name.
ulimit [-f [ n] ] If the -f n option is used, a size limit of n blocks is imposed on files written by child
processes (files of any size can be read). If n is not specified, the current limit is
printed. If no option is specified,
-f is assumed.
umask [ nnn] The user file-creation mask is set to nnn (see umask(2)). If nnn is omitted, the
current value of the mask is printed. See also umask(1).
unset [ name ... ] For each name, remove the corresponding variable or function. The variables PATH
,
PS1, PS2, MAILCHECK , and IFS cannot be unset.
wait [n ] Wait for the specified process and report its termination status. If n is not given all
currently active child processes are waited for and the return code is zero.
Invocation
Options can be specified in a single argument or in multiple arguments, but in all cases each option argu-
ment must begin with -. (All options except c, s, i, and r can also be prefaced with a +, which turns off
the associated option or options, but this is redundant when invoking a new shell because all options are
turned off by default).
If the first character of argument zero is -, commands are initially read from /etc/profile , then from
$HOME/.profile, if the files exist. Thereafter, commands are read as described below.
Section 1−−888 Hewlett-Packard Company − 7 − HP-UX 11i Version 1: September 2005