Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: posix compliance
- X-seq: zsh-workers 17345
- From: Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: jos@xxxxxxxxxxx, "'Clint Adams'" <clint@xxxxxxx>
- Subject: RE: posix compliance
- Date: Fri, 21 Jun 2002 09:19:15 +0400
- Cc: zsh-workers@xxxxxxxxxx
- Importance: Normal
- In-reply-to: <20020620180526.GA65950@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
> A quick report from UseNIX: One thing Jordan Hubbard of Apple
mentioned was
> that our positional parameters ($1, $2, etc.) are assignable whereas
they
> are
> not in bash (Chet Ramey, who was also present, confirmed this). The
bash
> behavior is apparently what POSIX specifies.
It depends.
SUS V3 (which I hope is quite reliable representation of POSIX) says
that interpretation of
WORD1=WORD2
where WORD1 is not a name is implementation defined. It may be legally
interpreted as assignment.
You are correct that in case of ${WORD1=WORD2} it is prohibited:
${parameter:=word}
Assign Default Values. If parameter is unset or null, the expansion of
word shall be assigned to parameter. In all cases, the final value of
parameter shall be substituted. Only variables, not positional
parameters or special parameters, can be assigned in this way.
In case of read built-in it is unclear. There are no explicit
restrictions; one may infer that special parameters are invalid only
from this line:
var
The name of an existing or nonexisting shell variable.
and only due to usage of "name" here.
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author