Re: (#i) curiosity

"Mark J. Reed" <[email protected]> Thu, 9 Apr 2026 16:20:32 -0400
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <CAA=-s3xOVyz8CFg7BECyALB4FoDkQVJr-t6VhsStN8knvY8ugQ@mail.gmail.com>
On Thu, Apr 9, 2026 at 4:13 PM Ray Andrews <[email protected]> wrote:

> The idea that when there is no match, somehow 'nullglob' still
> returns something (what?) to ls unclear.


It doesn't; with nullglob, a pattern that matches no files is replaced by
literally nothing. Not the empty string; there's nothing even to take up a
slot in the arguments.

So what happens if you run ls with no arguments? It displays the current
directory. And if you specify the -d option telling it to list directories
themselves instead of their contents, that looks like ".".

Really, I don't know why you're using ls to play with globs; it just
confuses the issue. Just use echo to see what's there. You only need to
pass the names to ls if you want more information than that the files
exist, like whether it's a directory or how big it is or the permissions or
something.

-- 
Mark J. Reed <[email protected]>