Re: Question about case statement in Bash docs

2021-05-10 Thread Chet Ramey
On 5/10/21 10:40 AM, Andreas Schwab wrote: On Mai 10 2021, Chet Ramey wrote: Either way, quote removal happens, the double quotes are removed, and the characters between the double quotes are treated specially. POSIX doesn't mention quote removal either. Is that a bug? There is the parenthe

Re: Question about case statement in Bash docs

2021-05-10 Thread Andreas Schwab
On Mai 10 2021, Chet Ramey wrote: > Either way, quote removal happens, the double quotes are removed, and > the characters between the double quotes are treated specially. POSIX doesn't mention quote removal either. Is that a bug? There is the parenthetical remark "(which also describes the eff

Re: Question about case statement in Bash docs

2021-05-10 Thread Chet Ramey
On 5/10/21 10:23 AM, Andreas Schwab wrote: On Mai 10 2021, Greg Wooledge wrote: On Mon, May 10, 2021 at 09:12:33PM +1000, AlvinSeville7cf wrote: x=test case $x in "test") echo Y esac Pattern is quoted but no quote removal is performed according to docs. Quote removal

Re: Question about case statement in Bash docs

2021-05-10 Thread Andreas Schwab
On Mai 10 2021, Greg Wooledge wrote: > On Mon, May 10, 2021 at 09:12:33PM +1000, AlvinSeville7cf wrote: >>x=test >>case $x in >>"test") echo Y >>esac >> >>Pattern is quoted but no quote removal is performed according to docs. > > Quote removal is essential, because of the

Re: Question about case statement in Bash docs

2021-05-10 Thread Chet Ramey
On 5/10/21 7:12 AM, AlvinSeville7cf wrote: Hello! Let’s consider the following snippet from [1]Bash docs: case word in [ [(] pattern [| pattern]…) command-list ;;]… esac It is written that: Each pattern undergoes tilde expansion, parameter expansion, command substitution, and a

Re: Question about case statement in Bash docs

2021-05-10 Thread Greg Wooledge
On Mon, May 10, 2021 at 09:12:33PM +1000, AlvinSeville7cf wrote: >x=test >case $x in >"test") echo Y >esac > >Pattern is quoted but no quote removal is performed according to docs. Quote removal is essential, because of the way the empty string is matched: case $foo in

Question about case statement in Bash docs

2021-05-10 Thread AlvinSeville7cf
Hello! Let’s consider the following snippet from [1]Bash docs: case word in [ [(] pattern [| pattern]…) command-list ;;]… esac It is written that: Each pattern undergoes tilde expansion, parameter expansion, command substitution, and arithmetic expansion. But if it’s true why the