variable

BASHOPTS

Readonly colon-separated list of enabled shopt options. Export affects a normal child Bash startup; not a guarantee of identical interpreter behavior.

Formal Syntax & Structure

bash syntaxbash
$BASHOPTS

Return Value

option list

Readonly colon-separated list of enabled shopt options. Export affects a normal child Bash startup; not a guarantee of identical interpreter behavior.

Working Example

Example Snippetbash
set -o pipefailshopt -s nullglobexport SHELLOPTS BASHOPTSbash -c '[[ -o pipefail ]] && printf "pipefail=on\n"; shopt -q nullglob && printf "nullglob=on\n"'
Bash Reference