| |
Understanding non-matches, continued | page 4 of 11 |
Here's what happened. Normally, when we specify a pattern, that pattern
matches one or more files on the underlying filesystem, and
bash replaces the pattern with a space-separated list of all
matching objects. However, when the pattern doesn't produce any matches,
bash leaves the argument, wildcards and all, as is. So when "ls" can't
find the file /usr/bin/asdf*jkl, it gives an error. The operative
rule here is that glob patterns are expanded only if they match objects in
the filesystem.
|