bug-bash
[Top][All Lists]
Advanced

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

Re: nullglob is documented incorrectly


From: Chet Ramey
Subject: Re: nullglob is documented incorrectly
Date: Mon, 6 Nov 2023 08:56:11 -0500
User-agent: Mozilla Thunderbird

On 11/5/23 5:15 AM, 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.

The null string (NULL) and the empty string ("") are not the same thing.

If nullglob is set, the non-matching pattern expands to the null string,
which is removed by word splitting.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

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