Shell Options
Bash provides a number of shell options, settings that you can change to modify the shell’s behavior. You control these options with the shopt command (see the entry for shopt). The following descriptions describe the behavior when set. Options marked with a dagger (†) are enabled by default:
autocdWhen the first word of a simple command cannot be executed, try to cd to it.
cdable_varsTreat a nondirectory argument to cd as a variable whose value is the directory to go to.
cdspellAttempt spelling correction on each directory component of an argument to cd. Allowed in interactive shells only.
checkhashCheck that commands found in the hash table still exist before attempting to use them. If not, perform a normal
PATHsearch.checkjobsWhen an attempt is made to exit a shell and there are stopped or running background jobs, the shell prints
Therearerunningjobs. and a list of jobs and their statuses. A second exit attempt (such as typing EOF again) causes the shell to exit.checkwinsizeCheck the window size after each command, and update
LINESandCOLUMNSif the size has changed.cmdhist†Save all lines of a multiline command in one history entry. This permits easy re-editing of multiline commands.
compat31Mutually exclusive with the
compat32andcompat40options. Restore the behavior of the=~operator for the[[ ]]command whereby the righthand side is always treated as a regular expression to be matched. In addition, the<and>operators ignore the locale when doing string ...
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