相关疑难解决方法(0)

使用 shopt -s autocd 有什么注意事项吗?

我最近发现了这个功能shopt -s autocd

          autocd  If  set,  a command name that is the name
                  of a directory is executed as if it  were
                  the argument to the cd command.  This op?
                  tion is only used by interactive shells.
Run Code Online (Sandbox Code Playgroud)

乍一看似乎很有帮助,但我不是 Bash 专家,我想知道使用它是否可能是错误的。

设置是否有任何潜在危险shopt -s autocd?我对脚本编写以及与其他应用程序或配置的冲突特别感兴趣。

bash cd-command shell-script shell-builtin shopt

3
推荐指数
1
解决办法
147
查看次数

标签 统计

bash ×1

cd-command ×1

shell-builtin ×1

shell-script ×1

shopt ×1