bug-bash
[Top][All Lists]
Advanced

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

Re: syntax error near unexpected token `select'


From: Paul Jarc
Subject: Re: syntax error near unexpected token `select'
Date: Thu, 06 Dec 2001 16:59:47 -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:
>> arg=( $(echo "$1"|cat) )

This works too, BTW, and does the same thing:
arg=( $1 )

> Straight array assignments like
>
> arg=(select)
>
> will fail because when the compound assignment is parsed, the parser will
> not return a `WORD' when `select' is parsed.

But *should* they fail?  This also fails:
  arg=(x select)
But this doesn't:
  echo select
Shouldn't the assignment cases have "select" parsed as it is in the
echo case?  Or else shouldn't the reserved word be treated as a plain
word in these cases?  The man page says: "The following words are
recognized as reserved when unquoted and either the first word of a
simple command (see SHELL GRAMMAR below) or the third word of a case
or for command".  These cases aren't either of those, so this is a
bug, right?


paul



reply via email to

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