Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: shwordsplit: final non-whitespace IFS character problem
On Fri, 4 Aug 2017 11:56:01 +0100
Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> 2017-08-04 04:03:19 +0200, Martijn Dekker:
> > In field/word splitting, a final non-whitespace IFS delimiter character
> > is counted as an empty field. This is unlike every other current shell
> > (including current versions of pdksh, i.e. mksh and OpenBSD ksh).
> >
> > Test script:
> >
> > setopt shwordsplit
> > IFS=:
> > x=a:b:
> > set -- $x
> > echo $#
> [...]
>
> IIRC, it was discussed before, and the concensus at the time was
> that it would be silly as the S in IFS stands for *S*eparator, not
> terminator nor delimiter.
Clearly it's not a good idea to change this in native mode.
> I can't imagine changing the behaviour in the sh/ksh emulations
> would be a problem (though I still think it's silly).
If everyone else does it, we should follow there. I guess POSIX_STRINGS
is as sensible an option to use as anything (though previous disclaimers
on partial use of POSIX options apply).
Not sure this is going to get done before the release.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author