From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: A.Main@dcs.warwick.ac.uk (Zefram)
Cc: zsh-workers@math.gatech.edu
Subject: Re: read broken in beta21
Date: Mon, 24 Jun 1996 13:57:53 +0200 (MET DST) [thread overview]
Message-ID: <199606241157.NAA02656@bolyai.cs.elte.hu> (raw)
In-Reply-To: <22461.199606211716@stone.dcs.warwick.ac.uk> from Zefram at "Jun 21, 96 06:16:10 pm"
> 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
next prev parent reply other threads:[~1996-06-24 12:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-21 17:16 Zefram
1996-06-24 11:57 ` Zoltan Hidvegi [this message]
1996-06-24 17:20 ` Zefram
1996-06-24 17:38 ` Zoltan Hidvegi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199606241157.NAA02656@bolyai.cs.elte.hu \
--to=hzoli@cs.elte.hu \
--cc=A.Main@dcs.warwick.ac.uk \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).