Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: read broken in beta21
- X-seq: zsh-workers 1430
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: A.Main@xxxxxxxxxxxxxxxxx (Zefram)
- Subject: Re: read broken in beta21
- Date: Mon, 24 Jun 1996 13:57:53 +0200 (MET DST)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <22461.199606211716@xxxxxxxxxxxxxxxxxxxxxxx> from Zefram at "Jun 21, 96 06:16:10 pm"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> It appears that the changes to bin_read in beta21 have introduced a
> bug. Trailing non-whitespace IFS characters on the input line are
> appended to the last parameter being set, instead of removed. This
> change has broken a script of mine. Or does POSIX require this? sh
> matches zsh's previous behaviour.
What is sh? On Linux, sh is bash which matches zsh's new behaviour. Other
sh's. Here is what POSIX says:
The line shall be split into fields (see the definition in 3.1.3) as in
the shell (see 3.6.5); the first field shall be assigned to the first
variable var, the second field to the second variable var, etc. If there
are fewer var operands specified than there are fields, the leftover
fields and their intervening separators shall be assigned to the last
var. If there are fewer fields than vars, the remaining vars shall be set
to empty strings.
So it is clear that the `intervening separators' should be assigned to the
last parameter. A non-whitespace IFS character is always a separator so it
should not be removed. bash and pdksh behaves as zsh while ksh93 removes
training non-whitespace IFS characters (which is wrong if I interpret POSIX
correctly). This also means that trailing IFS-whitespaces should be
removed as these are not and intervening separarators.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author