Unable to enable globstar in Bash 4

2019-01-26 09:21发布

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?

标签: bash bash4
1条回答
爷、活的狠高调
2楼-- · 2019-01-26 09:47

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?

查看更多
登录 后发表回答