On 4/6/13 9:59 PM, Chris F.A. Johnson wrote:
> In bash, the expansion differs when in [[ ... ]]:
>
> $ x=\\x; if [[ x == $x ]]; then echo yes; else echo no; fi
> yes
> $ x=\\x; if [ x == $x ]; then echo yes; else echo no; fi
> no
OK. The [[ conditional command does pattern matching. The [ (test)
command does string comparison. $x expands to `\x' in both cases.
>
> But not in ksh93:
I'm going to assume ksh93 dequotes the variable. I don't know why.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/