如何停用shopt
选项,例如extglob
?
我在.bashrc
文件中有这个:
shopt -s extglob
答案 0 :(得分:3)
使用-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