Closed subsetpark closed 3 years ago
This is consistent with shells, if you don't want that you pass the :x flag, see the docstring i guess.
Interesting, thanks for the pointer. When you say consistent, do you mean that returning the glob is equivalent to an error message like ls: cannot access 'src/*foo': No such file or directory
? Or is there some shell convention that actually prints a wildcard if it doesn't match anything?
shell passes the original string to the program if there was no glob match, that error message you posted comes from ls.
I have two directories,
full
andempty
.full
has a file in it;empty
does not. I would expect that a wildcard search inside offull
would return an array with one entry, and that a search inside ofempty
would return an empty array.Here's a session:
Instead of returning an empty array, a glob wildcard inside of an empty directory returns a string of the wildcard itself.