Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: On the quoting of braces
- X-seq: zsh-workers 29956
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: On the quoting of braces
- Date: Wed, 7 Dec 2011 21:43:16 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=08ifYAE/UhRxxbujh/IbOJGhMqGOOf8pAzo/oQPGO2U=; b=Gt35W1TKM+MRgvKhdLFUAwdusjzlLldQYd1HEvw3pPIgbfOF2v6mlEi7rnoxdO9Tp+ vr23tWPZBwoIYMNJkbdAzpuJ8Ck6fO1jyH+uZaLMHf6DWwh1AosUoBgnoZIZ2iOTbOdB nhtyDtv/rzRbmvq02HOAvFTjqnZpfYJh/Xn98=
- In-reply-to: <20111207203129.4401ddba@pws-pc.ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <87k469pcqk.fsf@gmail.com> <20111207203129.4401ddba@pws-pc.ntlworld.com>
On 2011-12-07, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Tue, 06 Dec 2011 23:16:35 +0100
> Christian Neukirchen <chneukirchen@xxxxxxxxx> wrote:
>> comparing different shells, I noticed zsh is overly careful for unquoted
>> braces:
>> zsh% echo { foo,bar }
>> zsh: parse error near `}'
>>
>> Why does this error appear?
>
> zsh allows a "}" to appear other than in command position at the end of
> a shell construct or a function definition:
>
> { echo }
>
> and
>
> fn() { echo }
>
> aren't complete statements in other shells. So this means a "}" is
> treated as special everywhere on the command line.
>
>> The only way to disable it seems to be
>> IGNORE_BRACES, which completely disables (the much used) brace expansion.
>
> Yes, this is really a different thing, since it doesn't involve a brace
> on its own as an argument. They shouldn't really be tied together. In
> fact, it looks like this additional effect of IGNORE_BRACES isn't even
> documented.
Under "RESERVED WORDS" we say:
Additionally, `}' is recognized in any position if the
IGNORE_BRACES option
is not set.
So maybe we should change that section too.
[...]
> Index: Doc/Zsh/options.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v
> retrieving revision 1.103
> diff -p -u -r1.103 options.yo
> --- Doc/Zsh/options.yo 18 May 2011 01:54:36 -0000 1.103
> +++ Doc/Zsh/options.yo 7 Dec 2011 20:28:41 -0000
> @@ -548,7 +548,32 @@ cindex(disabling brace expansion)
> cindex(brace expansion, disabling)
> cindex(expansion, brace, disabling)
> item(tt(IGNORE_BRACES) (tt(-I)) <S>)(
> -Do not perform brace expansion.
> +Do not perform brace expansion. For historical reasons this
> +also includes the effect of the tt(IGNORE_CLOSE_BRACES) option.
> +)
> +pindex(IGNORE_CLOSE_BRACES)
> +pindex(NO_IGNORE_CLOSE_BRACES)
> +pindex(IGNORECLOSEBRACES)
> +pindex(NOIGNORECLOSEBRACES)
> +item(tt(IGNORE_CLOSE_BRACES))(
> +When neither this option no tt(IGNORE_BRACES) is set, a sole
^^ nor
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author