HP-UX Reference (11i v2 03/08) - 1 User Commands A-M (vol 1)
k
ksh(1) ksh(1)
keyword Same as -k.
markdirs All directory names resulting from file name generation
have a trailing / appended.
monitor Same as -m.
noclobber Prevents redirection
> from truncating existing files.
Requires
>| to truncate a file when turned on.
noexec Same as -n.
noglob Same as -f.
nolog Do not save function definitions in history file.
nounset Same as -u.
privileged Same as -p.
verbose Same as -v.
trackall Same as -h.
vi Activates the insert mode of a vi-
style in-line editor
until you press the
ESC key which puts you in move
mode. A return sends the line.
viraw Each character is processed as it is typed in
vi mode.
xtrace Same as -x.
-p Disables processing of the $HOME/.profile
file and uses the file
/etc/suid_profile
instead of the ENV file. This mode is on when-
ever the effective uid (gid) is not equal to the real uid (gid). Turning this off
causes the effective uid and gid to be set to the real uid and gid.
-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.
- Turns off -x and -v options and stops examining arguments for options.
-- Do not change any of the options; useful in setting $1 to a value beginning
with -. If no arguments follow this option, the positional parameters are
unset.
Using
+ instead of - before a option causes the option to be turned off. These options
can also be used when invoking the shell. The current set of options can be examined by
using $-.
Unless
-A is specified, the remaining arg arguments are positional parameters and are
assigned consecutively to $1
, $2, ... . If neither arguments nor options are given, the
values of all names are printed on the standard output.
% shift [ n ] The positional parameters from $n+1 ... are renamed
$1 ... ; default n is 1. The param-
eter n can be any arithmetic expression that evaluates to a non-negative number less
than or equal to
$#.
test [ expr ] Evaluate conditional expression expr. See test (1) for usage and description. The arith-
metic comparison operators are not restricted to integers. They allow any arithmetic
expression. Four additional primitive expressions are allowed:
-L file True if file is a symbolic link.
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 ... ]
arg is a command read and executed when the shell receives signal(s) sig. (Note that arg
is scanned once when the trap is set and once when the trap is taken.) Each sig can be
given as a number or name of the signal. 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 has no effect. If arg is omitted or is -, all traps for sig 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 sig is DEBUG, arg is executed after each command. If sig is ERR, arg is exe-
cuted whenever a command has a non-zero exit code. If sig is 0 or EXIT and the trap
HP-UX 11i Version 2: August 2003 − 15 − Hewlett-Packard Company Section 1−−417