bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash prints syntax error when command in $(...) contains case-esac


From: Jan Schampera
Subject: Re: Bash prints syntax error when command in $(...) contains case-esac
Date: Tue, 30 Sep 2008 18:53:39 +0200
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

Juergen Gohlke wrote:

Description:
If a command in $(...) contains a case-esac construction, the bash prints a syntax error instead
       of executing the code:
       bash: syntax error near unexpected token `;;'

In case you have trouble with code you need, use this workaround:

x=$(a=4; case $a in (3) echo a=3;; (4) echo a=4;; esac)

And yes, I've also seen this before and I thought it was fixed - maybe I thought of something else.

J.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]