set Options

The options in set Options can be turned on with the set -arg command. They are all initially off except where noted. Full names, where listed, are arguments to set that can be used with set -o. The full names braceexpand, histexpand, history, keyword, and onecmd are not available in versions of bash prior to 2.0. Also, in those versions, hashing is switched with -d.

Table A-6. set options

Option

Full name (-o)

Meaning

-a

allexport

Export all subsequently defined or modified variables.

-B

braceexpand

The shell performs brace expansion. This is on by default.

-b

notify

Report the status of terminating background jobs immediately.

-C

noclobber

Don’t allow redirection to overwrite existing files.

-E

errtrace

Any trap on ERR is inherited by shell functions, command substitutions, and commands executed in a subshell environment.

-e

errexit

Exit the shell when a simple command exits with nonzero status. A simple command is a command not part of a while, until, or if; nor part of a && or || list; nor a command whose return value is inverted by !.

 

emacs

Use Emacs-style command-line editing.

-f

noglob

Disable pathname expansion.

-H

histexpand

Enable ! style history substitution. On by default in an interactive shell.

history

Enable command history. On by default in interactive shells.

-h

hashall

Enable the hashing of commands.

ignoreeof

Disallow Ctrl-D to exit the shell.

-k

keyword

All arguments in the form of assignment statements are placed in the environment for ...

Get bash Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.