zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: parenthesis inside $(...)
Date: Tue, 07 Feb 2006 20:15:51 +0000	[thread overview]
Message-ID: <200602072015.k17KFpEY003348@pwslaptop.csr.com> (raw)
In-Reply-To: Your message of "Tue, 07 Feb 2006 19:53:59 GMT." <20060207195359.GB5015@sc>

Stephane Chazelas wrote:
> $ zsh << \E
> heredoc> echo $(
> heredoc>    case x in  x) echo x;; esac
> heredoc> )
> heredoc> E
> zsh: parse error near `;;'
> zsh: parse error near `)'

Yes, it's known about (it's hinted at in the tip on page 314 of From
Bash to Z Shell: Conquering the Command Line, by Oliver Kiddle, Jerry
Peek and Peter Stephenson, Apress, ISBN 1 59059 376 6, in case anyone
hasn't got around to buying that yet) and the general feeling when this
came up here before was that it was pretty much inevitable.

The right way of constructing a nested case is with balanced
parentheses:

echo $(
   case x in (x) echo x;; esac
)

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page still at http://www.pwstephenson.fsnet.co.uk/


      reply	other threads:[~2006-02-07 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-07 19:53 Stephane Chazelas
2006-02-07 20:15 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200602072015.k17KFpEY003348@pwslaptop.csr.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).