1# let's try an error message first 2shopt -z 3 4# first, set up a known environment 5shopt -u cdable_vars 6shopt -s cdspell 7shopt -u checkhash 8shopt -u checkwinsize 9shopt -s cmdhist 10shopt -u dotglob 11shopt -u execfail 12shopt -s expand_aliases 13shopt -u extglob 14shopt -u histreedit 15shopt -u histappend 16shopt -u histverify 17shopt -s hostcomplete 18shopt -u huponexit 19shopt -s interactive_comments 20shopt -u lithist 21shopt -u mailwarn 22shopt -u nocaseglob 23shopt -u nullglob 24shopt -s promptvars 25shopt -u shift_verbose 26shopt -s sourcepath 27shopt -u xpg_echo 28 29# Now, start checking the output 30builtin printf -- "--\n" 31shopt -p # list 'em all 32builtin printf -- "--\n" 33# test specific variables 34shopt -p huponexit 35shopt -p checkwinsize 36shopt -p sourcepath 37 38builtin printf -- "--\n" 39shopt -s -p 40builtin printf -- "--\n" 41shopt -u -p 42builtin printf -- "--\n" 43shopt -u 44 45# Now set up another known environment 46set +o allexport 47set -o braceexpand 48set +o errexit 49set -o hashall 50set -o histexpand 51set +o keyword 52set -o monitor 53set +o noclobber 54set +o noexec 55set +o noglob 56set +o notify 57set +o nounset 58set +o onecmd 59set +o physical 60set -o privileged 61set +o verbose 62set +o xtrace 63set -o history 64set +o ignoreeof 65set -o interactive-comments 66set +o posix 67set -o emacs 68set +o vi 69 70# list 'em all 71builtin printf -- "--\n" 72shopt -o -p 73 74builtin printf -- "--\n" 75set -o 76builtin printf -- "--\n" 77set +o 78 79# test specific variables 80builtin printf -- "--\n" 81shopt -p -o history 82shopt -p -o verbose 83 84builtin printf -- "--\n" 85shopt -s -p -o 86builtin printf -- "--\n" 87shopt -u -p -o 88builtin printf -- "--\n" 89shopt -u -o 90 91# errors 92builtin printf -- "--\n" 93shopt -p xyz1 94shopt -o -p xyz1 95