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

s
sh-posix(1) sh-posix(1)
% exit [n]
Exit from the shell with the exit status specified by n.Ifn is omitted, the exit status is that of the last
command executed. An end-of-file also causes the shell to exit, except when a shell has the
ignoreeof option set. (See the set special command.)
%& export [name[=value]]...
%&
export -p
Mark the given variable names for automatic export to the environment of subsequently executed
commands. Optionally, assign values to the variables.
With -p, write the names and values of all exported 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 exporting results.
fc [-r][-e
ename][first [last]]
fc -l [-nr][first [last]]
fc -s [old=new][first]
fc -e - [old=
new][command]
List, or edit and reexecute, commands previously entered to an interactive shell. A range of com-
mands from first to last is selected from the last
HISTSIZE 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 negative number is used to offset the current command number.
With -l, list the commands on standard output. Without -l, invoke the editor program ename 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 command specified by first is used. If first is not
specified, the default is the previous command for editing and 16 for listing.
With
-r, reverse the order of the commands.
With -n, suppress command numbers when listing.
With -s, reexecute the command without invoking an editor.
The old=new argument replaces the first occurrence of string old in the command to be reexecuted by
the string new.
fg [job]...
Bring each job into the foreground in the order specified. If no job is specified, bring the current job
into the foreground. See the "Jobs" subsection for a description of the format of job.
getopts optstring name [arg]...
Parse the argument list, or the positional parameters if no arguments, for valid options. On each exe-
cution, return the next option in name. See getopts(1) for usage and description.
An option begins with a
+ or a -. An argument 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.
For an option specified as
-letter, name is set to letter. For an option specified as +letter, name is set
to
+letter. The index of the next arg is stored in OPTIND. The option argument, if any, is stored in
OPTARG. If no option argument is found, or the option found does not take an argument, OPTARG is
unset.
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 argument is missing. Other-
wise, getopts prints an error message. The exit status is nonzero when there are no more options.
& hash [utility]...
& hash -r
Affect the way the current shell environment remembers the locations of utilities. With utility, add
utility locations to a list of remembered locations. With no arguments, print the contents of the list.
With -r, forget all previously remembered utility locations.
HP-UX 11i Version 1: September 2005 6 Hewlett-Packard Company Section 1897