我最近发现了这个功能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?我对脚本编写以及与其他应用程序或配置的冲突特别感兴趣。