Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
set -x and [[ xxxx = pattern ]]
- X-seq: zsh-workers 24988
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: set -x and [[ xxxx = pattern ]]
- Date: Sat, 10 May 2008 17:18:23 +0100
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hiya,
$ zsh -xc '[[ a = * ]]'
+zsh:1> [[ a == '*' ]]
$ zsh -xc "[[ a = '*' ]]"
+zsh:1> [[ a == '*' ]]
$ zsh -xc '[[ a = "*" ]]'
+zsh:1> [[ a == '*' ]]
Shouldn't the output be different? (same goes for "case").
I'd expect the [[ x = * ]] to show [[ x == * ]]
bash and ksh seem to be doing better here:
~$ bash -xc '[[ a = * ]]'
+ [[ a = * ]]
~$ bash -xc '[[ a = *"*" ]]'
+ [[ a = *\* ]]
(1)~$ ksh -xc '[[ a = * ]]'
+ [[ a == * ]]
~$ ksh -xc '[[ a = *\* ]]'
+ [[ a == *\* ]]
~$ ksh -xc '[[ a = *"*" ]]'
+ [[ a == *\* ]]
~$ a='*' ksh -xc '[[ a = $a ]]'
+ [[ a == * ]]
~$ a='*' ksh -xc '[[ a = "$a" ]]'
+ [[ a == \* ]]
~$ a='*' bash -xc '[[ a = $a ]]'
+ [[ a = * ]]
~$ a='*' bash -xc '[[ a = "$a" ]]'
+ [[ a = \* ]]
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author