例如,如何禁用一个shopt
选项extglob
?
我的.bashrc
文件中有这个:
shopt -s extglob
使用-u
选项:
shopt -u extglob
-s
用于设置,-u
用于取消设置。从help shopt
(或shopt --help
在 BSD 系统上):
Options:
-o restrict OPTNAMEs to those defined for use with `set -o'
-p print each shell option with an indication of its status
-q suppress output
-s enable (set) each OPTNAME
-u disable (unset) each OPTNAME
要了解如何以干净的方式进行 shopt,请参阅:
https://github.com/codeforester/base/blob/master/lib/shopt.sh