setset KornShell flags and positional parameters |
KornShell Built-in |
set [±abCefhiKkmnpstuvx-]
[±Aname]
[±[ flag]]
[parameter ...]
set without arguments displays the names and
values of all KornShell variables, sorted by name, in the following format:
The quoting allows the output to be re-input to the shell using the built-in commandVariable="value"
eval.
-option set each
KornShell flag specified as an option.
Similarly, arguments of the form +option
turn off each of the KornShell flags specified as an option.
All of the set options except
±A, -s,
-, and -- are
shell flags. KornShell flags can also be set on the
sh command line at
invocation.
+A nameassigns the parameter list to the elements of name, starting at name[0].
-A nameunsets name, then assigns the parameter list to the elements of name starting at name[0].
-asets all subsequently defined variables for export.
-bnotifies you when background jobs finish running.
-Cprevents the output redirection operator > from
overwriting an existing file. Use the alternate operator >|
to force an overwrite.
-etells a non-interactive shell to execute the ERR trap and then
exit, whenever a simple command returns a non-zero exit.
This flag is disabled when reading profiles.
-fdisables path name expansion.
-hmakes all commands use tracked aliases. (See
sh for an explanation of tracked
aliases.)
-imakes the shell interactive.
-Ktells the shell to use Korn-compatible behavior in any case where the
POSIX.2 behavior is different from the behavior specified by Korn. In
particular, this affects the
trap command.
-kallows assignment parameters anywhere on the command line and still includes them in the environment of the command.
-Lmakes the shell a login shell. Setting this flag is effective only at shell invocation.
-mruns each background job in a separate process group and reports on each (to standard error) as they complete.
-ntells a non-interactive shell to read commands but not execute them.
±o flagsets the specified shell flag. If you do not specify flag, this option lists all shell flags which are currently set. flag can be one of the following:
allexport-a option.errexit-e option.bgniceemacsemacs style in-line editor for command
entry.gmacsgmacs style in-line editor for command
entry.ignoreeofinteractive-i optionkeyword-k option.korn-K optionlogicallogin-L option of sh.markdirs/ to directory names when generating using
wild card characters.monitor-m option.noclobber-C option.noerrorbellsnoexec-n option.noglob-f option.nolognoposixpids$$ and $! are
displayed using this method.notify-b option.nounset-u option.privileged-p option.tabcompletevi,
emacs, or gmacs editing modes.trackall-h option.verbose-v option.vivi style in-line editor for command
entry.xtrace-x option.See shedit for a
description of the effect of setting options emacs,
gmacs, or vi.
-presets PATH variable to default value,
disables processing of HOME/.profile
and uses file /etc/suid_profile
instead of the file in the ENV variable.
-ssorts the positional parameters.
-texits after reading and executing one command.
-utells the shell to give an error message if an unset parameter is used in a substitution.
-vprints shell input lines as they are read.
-xprints commands and their arguments as they execute.
-turns off -v and -x flags. Also,
parameters which follow this option do not set shell flags, but are
assigned to positional parameters (see
sh).
--parameters which follow this option do not set shell flags, but are assigned to positional parameters.
0Successful completion.
1Invalid command line argument.
2Failure resulting in a usage message, usually due to a missing argument.
set is a built-in command of the Bourne Shell and
KornShell on UNIX.
The Bourne shell only has the -a, -e,
-h, -k, -n,
-t, -u, -v, and
-x flags.
The shell flags ±A, ±h,
±i, -K,
±k, ±p,
-s, ±t,
bgnice, emacs, gmacs,
guierror, interactive,
keyword, korn,
logical, login,
markdirs, noerrorbell,
nolog, privileged,
tabcomplete, and trackall
are extensions to the POSIX and XPG standards.
Of these extensions, ±A, ±h,
±p, -s, ±t,
bgnice, emacs, gmacs,
keyword, markdirs,
nolog, privileged, and
trackall are found in the KornShell.