cc: 
Subject: Re: [ksh93-integration-discuss] AW: [ast-users] Defining pattern mode  
(like "~(E)") via variables
--------

> Does anyone know why
> 
> $ (ksh93 "mode='[[ "hello" == ~(E).*hello ]] && echo 'bar'")
> bar
> 
> works but
> 
> $ (ksh93 "mode='~(E)' ; [[ "hello" == ${mode}.*hello ]] && echo 'bar'")
> 
> does not produce a match?


When patterns are used as command arguments for file name generation,
it does not recognize the characters ~ ( and ) as special so
that old Bourne shell scripts will not break.  However, this
should work inside [[ ... ]].

I just tried this in ksh93s- and it does produce a match.
It was a bug kn ksh93r that was fixed.

David Korn
dgk at research.att.com

Reply via email to