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

Re: command substitution gets confused by case parens



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   



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