zsh-workers
 help / color / mirror / code / Atom feed
* command substitution gets confused by case parens
@ 2002-05-21  5:48 Clint Adams
  2002-05-21 15:07 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2002-05-21  5:48 UTC (permalink / raw)
  To: zsh-workers

According to POSIX, I think, the following should work.

print $(case $TEST in
 abc)
 echo a   
 ;;            
 def)
 echo b   
 ;;   
esac)
zsh: parse error near `;;'


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

* Re: command substitution gets confused by case parens
  2002-05-21  5:48 command substitution gets confused by case parens Clint Adams
@ 2002-05-21 15:07 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2002-05-21 15:07 UTC (permalink / raw)
  To: Clint Adams, zsh-workers

On May 21,  1:48am, Clint Adams wrote:
} Subject: command substitution gets confused by case parens
}
} According to POSIX, I think, the following should work.

Bash2 chokes on it as well:

bash2: command substitution: line 2: syntax error near unexpected token `abc'
bash2: command substitution: line 2: ` abc'

The following works in both shells, and is the reason that the fully-
parenthesized case conditions were introduced, IIRC.

    echo $(case $TEST in
     (abc)
      echo a   
      ;;            
     (def)
      echo b   
      ;;   
    esac)


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

end of thread, other threads:[~2002-05-21 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-21  5:48 command substitution gets confused by case parens Clint Adams
2002-05-21 15:07 ` Bart Schaefer

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).