HP-UX Reference (11i v2 03/08) - 1 User Commands A-M (vol 1)
k
ksh(1) ksh(1)
fc [ -eename ][-nlr
][first [ last ]]
fc -e - [ old=new ][command ]
In the first form, a range of commands from first to last is selected from the last
HIST-
SIZE commands typed at the terminal. The arguments first and last can be specified as
a number or string. A given string is used to locate the most recent command. A nega-
tive number is used to offset the current command number. The
-l option causes the
commands to be listed on standard output. Otherwise, the editor program ename is
invoked on a file containing these keyboard commands. If ename is not supplied, the
value of the parameter
FCEDIT (default /usr/bin/ed) is used as the editor. Once
editing has ended, the commands (if any) are executed. If last is omitted, only the com-
mand specified by first is used. If first is not specified, the default is the previous com-
mand for editing and −16 for listing. The
-r option reverses the order of the commands
and the
-n option suppresses command numbers when listing. In the latter, the com-
mand is re-executed after the substitution old
=
new is performed.
fg [ job ... ] Brings each job into the foreground in the order specified. If no job is specified, the
current job is brought into the foreground. See Jobs for a description of the format of job.
getopts optstring name
[ arg ...]
Checks arg for legal options. If arg is omitted, the positional parameters are used. An
option argument begins with a
+ or a
-. An option not beginning with + or -, or the
argument
--ends the options. optstring contains the letters that getopts recognizes. If
a letter is followed by a :, that option is expected to have an argument. The options can
be separated from the argument by blanks.
getopts places the next option letter it finds inside variable name each time it is
invoked with a + preceding it when arg begins with a +. The index of the next arg is
stored in
OPTIND. The option argument, if any, gets stored in OPTARG.
A leading
: in optstring causes getopts to store the letter of an invalid option in
OPTARG, and to set name to ? for an unknown option and to : when a required option
is missing. Otherwise, getopts prints an error message. The exit status is non-zero
when there are no more options. See also getopts(1).
jobs [ -lnp ][job ... ]
Lists information about each given job; or all active jobs if job is omitted. The -l
option
lists process ids in addition to the normal information. The
-n option only displays jobs
that have stopped or exited since last notified. The -p option causes only the process
group to be listed. See Jobs for a description of the format of job.
kill [ -sig] process ...
Sends either the TERM (terminate) signal or the specified signal to the specified jobs or
processes. Signals are given either by number or name (as given in signal(5), stripped of
the prefix SIG). The signal names are listed by kill -l. No default exists; merely typ-
ing kill does not affect the current job. If the signal being sent is TERM
(terminate) or
HUP (hangup), the job or process is sent a CONT (continue) signal when stopped. The
process argument can be either a process ID or job. If the first argument to kill is a
negative integer, it is interpreted as a sig argument and not as a process group. See also
kill(1).
let arg ... Each arg is a separate arithmetic expression to be evaluated. See Arithmetic Evalua-
tion above, for a description of arithmetic expression evaluation. The exit status is 0 if
the value of the last expression is non-zero, and 1 otherwise.
% newgrp [ arg ... ]
Equivalent to exec newgrp arg ....
print[ -Rnprsu[ n ]] [arg ... ]
The shell output mechanism. With no options or with option - or --the arguments are
printed on standard output as described by echo(1). Raw mode, -R or -r, ignores the
escape conventions of echo. The -R option prints all subsequent arguments and options
other than -n. The -p option causes the arguments to be written onto the pipe of the
process spawned with |& instead of standard output. The -s option causes the argu-
ments to be written onto the history file instead of standard output. The -u option can
be used to specify a one-digit file descriptor unit number n on which the output is to be
placed. The default is 1. If the option -n is used, no new-line character is added to the
output.
HP-UX 11i Version 2: August 2003 − 13 − Hewlett-Packard Company Section 1−−415