John <[EMAIL PROTECTED]> writes: > Take, for example, the string "1|2". when used in the form case 2 in > \ 1|2) ... the function execute_case_command, in the strmatch line. This > line is executed twice, once being a strmatch (2,1) and the other being > strmatch (2,2). Obviously the 2,2 is the match. > > On the other hand, when a variable VAR='1|2' is used (case 2 in $var > ... ) the comparison performed is strmatch (2,1|2) which fails. 1|2 is never > broken into its components.
Meta characters that are part of the shell syntax are only recognized when literal characters, not when part of an expansion. You can get around that rule by using eval, which rereads the argument as input to the shell. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."