Adjusting Shell Behavior Using set, shopt, and Environment Variables

This section combines Table A-5, set Options, and shopt options and provides a quick way to look for what you can configure and which of the three mechanisms you use to configure it. The options are loosely grouped according to function or purpose, but it’s worthwhile to scan the entire table to get an overall sense of what you can configure.

The “Set option” column contains the options that can be turned on with the set -arg command. All are initially off except where noted. Items in the “Set full name” column, 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.

The “Shopt option” column shows the options set with shopt -s arg and unset with shopt -u arg. Versions of bash prior to 2.0 had environment variables to perform some of these settings. Setting them equated to shopt -s. The variables (and corresponding shopt options) were: allow_null_glob_expansion (nullglob), cdable_vars (cdable_vars), command_oriented_history (cmdhist), glob_dot_filenames (dotglob), no_exit_on_failed_exec (execfail). These variables no longer exist.

The options extdebug, failglob, force_fignore, and gnu_errfmt are not available in versions of bash prior to 3.0.

The “Environment variable” column lists environment variables that affect bash configuration ...

Get bash Cookbook now with the O’Reilly learning platform.

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