
shopt | 683
Bash and Korn
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Examples
set -- "$num" -20 -30 Set $1 to $num, $2 to -20, $3 to -30
set -vx Read each command line; show it;
execute it; show it again (with arguments)
set +x Stop command tracing
set -o noclobber Prevent file overwriting
set +o noclobber Allow file overwriting again
shopt
shopt [-opqsu] [option]
Bash only. Sets or unsets shell options. With no options or just -p,
prints the names and settings of the options.
Options
-o Each option must be one of the shell option names for set -o,
instead of the options listed in the next section.
-p Print the option settings as shopt commands that can be
reread later.
-q Quiet mode. The exit status is zero if the given option is set,
nonzero otherwise. With multiple options, all of them must be
set for a zero exit status.
-s Set the given options. With no options, prints only those that
are set.
-u Unset the given options. With no options, prints only those
that are unset.
-o physical -P •
-o pipefail ••
-o posix •
-o privileged -p •••
-o trackall -h ••
-o verbose -v •••
-o vi •••
-o viraw ••
-o xtrace -x •••
-p -o privileged •••
-P -o physical •
-s ••
-t -o onecmd •••
-T -o functrace •
-u -o nonunset •••
-v -o verbose •••
-x -o xtrace •••
Option Same as ksh88 ksh93 Bash