Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command substitution gets confused by case parens
- X-seq: zsh-workers 17204
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Clint Adams <clint@xxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: command substitution gets confused by case parens
- Date: Tue, 21 May 2002 15:07:26 +0000
- In-reply-to: <20020521054822.GA21674@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20020521054822.GA21674@xxxxxxxx>
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