Unable to enable globstar in Bash 4
Asked Answered
F

1

12

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?

Fiddle answered 27/4, 2009 at 14:20 Comment(0)
S
22

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?

Smallman answered 27/4, 2009 at 14:59 Comment(4)
Thank you! I apparently did not remember to restart my shell.Cnemis
$0 --version does not work. You should type echo $0 or $SHELL --version to verify your shellEudemonism
To disable: shopt -u globstar.Allahabad
line 1: shopt: globstar: invalid shell option nameJoanniejoao

© 2022 - 2024 — McMap. All rights reserved.