SET(1)

NAME

set - set shell options and positional parameters.

SYNOPSIS

set [+-abCefhmnuvx] [+-o option] [argument ...]
set -o
set +o
set -- [argument ...]

DESCRIPTION

set is a POSIX special builtin provided by Rush. A - option enables a setting and the corresponding + option disables it. Remaining operands replace the positional parameters. set -- clears them when no operands follow.

With no operands, set prints shell variables. set -o prints named option states, while set +o prints reusable commands that reproduce the current named option settings.

OPTIONS

ShortNamedEffect
-aallexportExport variables assigned afterward.
-bnotifyReport completed background jobs without waiting for the next prompt.
-CnoclobberPrevent ordinary output redirections from replacing existing regular files.
-emacsUse Emacs-style interactive line editing. On by default; mutually exclusive with vi.
-eerrexitExit after an untested command failure.
-fnoglobDisable pathname expansion.
-hhashallRemember command paths as commands are found.
-m-Enable job control.
-nnoexecRead commands without executing them.
-pipefailUse the rightmost non-zero pipeline status, or zero if all commands succeed.
-unounsetTreat expansion of unset parameters as an error where required by the shell language.
-vverboseWrite shell input as it is read.
-viUse POSIX vi interactive line editing. Mutually exclusive with emacs.
-xxtraceTrace expanded commands before execution.

Use set -o name or set +o name to enable or disable a named option. Short options may be combined.

emacs is Rush's default interactive editing mode and an implementation extension: POSIX.1-2024 does not standardize shell Emacs bindings. set -o vi enables vi mode and disables emacs; set +o vi restores the default Emacs-style option. set +o emacs clears the explicit Emacs option without enabling vi.

EXIT STATUS

Zero on success and two for invalid options or option names.

SEE ALSO

rush-builtins(7), POSIX Shell Command Language.