zsh-workers
 help / color / mirror / code / Atom feed
* set -x and [[ xxxx = pattern ]]
@ 2008-05-10 16:18 Stephane Chazelas
  2008-05-11 19:49 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Chazelas @ 2008-05-10 16:18 UTC (permalink / raw)
  To: Zsh hackers list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-11 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-10 16:18 set -x and [[ xxxx = pattern ]] Stephane Chazelas
2008-05-11 19:49 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).