Unable to enable globstar in Bash 4

Unable to enable globstar in Bash 4

凌乱心跳 发布于 2021-11-29 字数 320 浏览 798 回复 1 原文

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?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。



需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。


Hmm. shopt -s globstar should work.

To debug, make sure you are running Bash 4:

$SHELL --version

Then check the setting of globstar:

shopt globstar

If it is unset, try setting it manually:

shopt -s globstar

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?