help-bash
[Top][All Lists]
Advanced

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

Re: case $var in $list) issue


From: Greg Wooledge
Subject: Re: case $var in $list) issue
Date: Fri, 1 Nov 2024 07:15:42 -0400

On Fri, Nov 01, 2024 at 06:00:49 +0100, #!microsuxx wrote:
> shopt -s extglob
> m='@(a|b)' ; case b in $m) echo ye ; esac
> ye

Huh, interesting indeed.

hobbit:~$ shopt -s extglob
hobbit:~$ m='a|b'
hobbit:~$ case b in $m) echo ye ; esac
hobbit:~$ m='@(a|b)'
hobbit:~$ case b in $m) echo ye ; esac
ye

I can only speculate that it sometimes re-parses the contents of $m
based on the first character.



reply via email to

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