Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: quoting bug
- X-seq: zsh-workers 1407
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: A.Main@xxxxxxxxxxxxxxxxx (Zefram)
- Subject: Re: quoting bug
- Date: Fri, 21 Jun 1996 16:30:08 +0200 (MET DST)
- Cc: stephens@xxxxxxxxxxx, zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <6066.199606211417@xxxxxxxxxxxxxxxxxxxxxxx> from Zefram at "Jun 21, 96 03:17:10 pm"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> >> setopt SH_WORD_SPLIT
> >
> >What does POSIX say?
>
> POSIX requires the SH_WORD_SPLIT behaviour. It also requires field
> splitting in normal words, as well as the result of expansions:
>
> % setopt SH_WORD_SPLIT
> % IFS=x
> % echo fooxbar
> fooxbar
No. POSIX does not allow field splitting here:
"IFS is used for performing field splitting on the results of parameter
and command substitution; it is not used for splitting all fields.
Previous versions of the shell used it for splitting all fields during
field splitting, but this has severe problems because the shell can no
longer parse its own script. There are also important security
implications caused by this behavior. All useful applications of IFS use
it for parsing input of the read utility and for splitting the results of
parameter and command substitution. New versions of the shell have fixed
this bug, and POSIX.2 requires the corrected behavior."
> I think we should implement this behaviour -- when SH_WORD_SPLIT is
> set, of course. It should be very easy. I also think we should retain
> the current default, as it's much nicer behaviour.
Yes, it can be implemented easily by adding IBLANK type to IFS elements but
I still think that it is unnecessary. And there may be hidden problems as
this change affects the parser.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author