Name
set
Synopsis
set [options arg1 arg2 …]With no arguments, set
prints the values of all variables known to the current shell.
Options can be enabled (-option) or disabled
(+option). Options can also be set when the
shell is invoked. (See the earlier section Invoking the Shell.) Arguments are assigned in order
to $1, $2, etc.
Options
-aFrom now on, automatically mark variables for export after defining or changing them.
-bPrint job completion messages as soon as jobs terminate; don't wait until the next prompt.
-BEnable brace expansion. On by default.
-CPrevent overwriting via
>redirection; use>|to overwrite files.-eExit if a command yields a nonzero exit status. The
ERRtrap executes before the shell exits.-ECause shell functions, command substitutions, and subshells to inherit the
ERRtrap.-fIgnore filename metacharacters (e.g.,
* ? [ ]).-hLocate commands as they are defined. On by default. See hash.
-HEnable csh-style history substitution. On by default.
-kAssignment of environment variables (var=value) takes effect regardless of where they appear on the command line. Normally, assignments must precede the command name.
-mEnable job control; background jobs execute in a separate process group.
-mis usually set automatically.-nRead commands but don't execute; useful for checking syntax. The shell ignores this option if interactive.
+o[mode]With mode, disable the given shell option. Plain
set +oprints the settings of all the current options. This is in a form that can be reread by ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access