bug-bash
[Top][All Lists]
Advanced

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

Re: reporting of "{x" non ideal


From: Paul Jarc
Subject: Re: reporting of "{x" non ideal
Date: Tue, 27 Nov 2001 17:36:06 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 (i386-redhat-linux-gnu)

Chet Ramey <chet@nike.ins.cwru.edu> wrote:
>>> $ test a||{false;true;}&&echo $?
>>> bash: syntax error near unexpected token `&'
...
> The problem is that `{' and '}' are reserved words, not operators,
...
> The statement is parsed as
>
> test a || {false
> true
> }&&echo $?
>
> The first two are obviously valid commands.  The last is a syntax error.
> The offending token is `&'.

Um, "&&" *is* an operator.  So shouldn't the token be "&&"?  And
shouldn't the *offending* token be "}", since the problem is that
there is no matching "{"?  And if so, could the error message be
changed to indicate that the most likely cause is a missing space
after a "{" somewhere?

> ["{" and "}"] are only recognized as such when reserved words are
> recognized: in a command position, and separated by whitespace from
> other input.

Shouldn't any metacharacter be enough to separate them?

I assume brace expansion is not interfering due to the lack of a
comma, right?


paul



reply via email to

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