2019-07-04 09:26:50 +0100, Geoff Clare:
[...]
> > > 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?
[...]
See 2.6.2 parameter expansion:
} If a parameter expansion occurs inside double-quotes:
}
} • Pathname expansion shall not be performed on the results of the expansion.
}
} • Field splitting shall not be performed on the results of the expansion.
I'm sure there's something similar for ${a#"$b"} or case $a in ("$b")
--
Stephane