Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[doogie@xxxxxxxxxxxxx: Bug#163237: zsh barfs on valid shell]



This happens under emulate -R sh as well.

----- Forwarded message from Adam Heath <doogie@xxxxxxxxxxxxx> -----

adam@yakko:~$ for shell in ash bash zsh ksh; do echo -n "$shell:"; $shell -c 'case foo in (foo)echo foo;;(bar)echo bar;;esac';done
ash:foo
bash:foo
zsh:zsh: parse error near `foo'
ksh:foo
adam@yakko:~$ for shell in ash bash zsh ksh; do echo -n "$shell:"; $shell -c 'case foo in (foo) echo foo;;(bar) echo bar;;esac';done
ash:foo
bash:foo
zsh:foo
ksh:foo

http://www.opengroup.org/onlinepubs/007904975/utilities/xcu_chap02.html#tag_02_10_02

Scroll down a bit to the actual grammer(surrounded by <pre>):

The case_item and case_item_ns show that there is no required space(or other
break char) between the ')' and the compound_list.

case_item_ns     :     pattern ')'               linebreak
                 |     pattern ')' compound_list linebreak
                 | '(' pattern ')'               linebreak
                 | '(' pattern ')' compound_list linebreak
                 ;
case_item        :     pattern ')' linebreak     DSEMI linebreak
                 |     pattern ')' compound_list DSEMI linebreak
                 | '(' pattern ')' linebreak     DSEMI linebreak
                 | '(' pattern ')' compound_list DSEMI linebreak



----- End forwarded message -----



Messages sorted by: Reverse Date, Date, Thread, Author