bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nullglob is documented incorrectly


From: Andreas Kähäri
Subject: Re: nullglob is documented incorrectly
Date: Sun, 5 Nov 2023 11:45:23 +0100

On Sun, Nov 05, 2023 at 11:15:50AM +0100, Emanuele Torre wrote:
> Today, a user in the #bash IRC channel of libera.chat, misunderstood how
> nullglob is supposed to work because is documented incorrectly in the
> man page:
> 
>     'nullglob'
>          If set, Bash allows filename patterns which match no files to
>          expand to a null string, rather than themselves.
> 
> globs expand to nothing if there are no matches with nullglob set, not
> to the null/empty string.
> 
> o/
>  emanuele6

It may even be better to say that the patterns that do not match
any names are *removed*.  That way one avoids the complications and
ambiguities of explaining what the pattern expands or not expands to.


-- 
Andreas (Kusalananda) Kähäri
Uppsala, Sweden

.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]