无法在 Bash 4 中启用 globstar
我未成功地将以下内容添加到我的 .bashrc
shopt -s globstar
我正在尝试通过
ls **/*.c
进行比较来测试该命令的实际运行情况
ls */*/*.c
将其与How can you enable globstar in Bash 4?
I put the following unsuccessfully to my .bashrc
shopt -s globstar
I am trying to test the command in action by
ls **/*.c
and by comparing it to
ls */*/*.c
How can you enable globstar in Bash 4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
唔。
shopt -s globstar
应该可以工作。要进行调试,请确保您正在运行 Bash 4:
然后检查
globstar
的设置:如果未设置,请尝试手动设置:
现在看看是否有效。 如果确实如此,您可能需要调查一下
.bashrc
无法工作的原因。 您是否记得在编辑.bashrc
后重新启动 shell,或者使用加载它。 .bashrc?
Hmm.
shopt -s globstar
should work.To debug, make sure you are running Bash 4:
Then check the setting of
globstar
:If it is unset, try setting it manually:
Now see if that works. If it does, you might want to look into why your
.bashrc
isn't working. Did you remember to restart you shell after editing your.bashrc
, or load it with. .bashrc
?