Set bash's shell option nullglob by default?

Roman Rakus rrakus at redhat.com
Fri Jul 13 12:15:18 UTC 2012


On 07/13/2012 02:06 PM, Scott Schmit wrote:
> So ls *.foo should list the entire directory if no files match *.foo?
> It's a bad habit for me to expect ls *.foo to return nothing in this
> case? You're going to need to convince me.
And if there are directories ending with .foo? Hopefully you are not 
using such things in scripts.
OK, in interactive shells `ls *' is not that wrong.

printf '%s\n' *.foo
for file in *.foo; do ... done

RR


More information about the devel mailing list