如何禁用 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
关于bash - 如何在 Bash 中禁用 shopt 选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44235158/