4 ms·
"A more intuitive solution would be to resolve globs to nothing (the empty string) if they don't match." I agree, so I use shopt -s nullglob in both bash scrip
by ukfarmer 5y ago
"A more intuitive solution would be to resolve globs to nothing (the empty string) if they don't match."
I agree, so I use shopt -s nullglob in both bash scripts and interactive shells. It retrained my interactive habits with find very quickly because unquoted wildcards no longer work in the common case where there's no match in the current directory.
(I like dotglob, extglob, globstar and pipefail everywhere too: saner defaults than emulating traditional shell behaviours.)