[Starting a new thread for this so it doesn't get lost in the bug 1234 one]
Geoff Clare <[email protected]> wrote, on 04 Jul 2019: > > Subject: Re: [1003.1(2016)/Issue7+TC2 0001234]: in most shells, backslash > doesn't have two meaning wrt pattern matching > > Harald van Dijk <[email protected]> wrote, on 03 Jul 2019: > > > > [...] shell quoting can be used on the asterisk: just try > > > > a='*' > > ls -ld "$a" > > > > This does work for listing only a file literally named '*'. > > That's because of the double quotes around $a. Pathname expansion > is not done inside double quotes, so there is no pattern here, just > a string that contains a '*'. Having said that, I now can't find the place in the standard that covers this. Am I just not finding it, or is it genuinely missing? Note that 2.2.3 Double-Quotes is not sufficient. It says double-quotes preserve the literal value of (certain) characters within the double-quotes. The '*' is not within the double-quotes, so that doesn't apply to it. -- Geoff Clare <[email protected]> The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England
