Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Procmail rejects zsh as being "broken"



srb@xxxxxxx wrote:
> The test should have read (fixed in the next release :-):
> 
>         *zsh*) $RM src/_autotst
>             $SHELL <<HERE
>             O="echo test"
>             exec 2>$DEVNULL 1>&2
>             \$O && echo test >src/_autotst
> HERE
> 
> As to why it is just being tested on zsh, well, that's the only shell
> that (ever) exhibited this (broken) behaviour.

It's *not* broken.  See the FAQ.  Zsh has arrays if you want the
variable to have separate words.  Having it splitting on every single
space in every single variable is the broken behaviour, inherited from
the time when arrays didn't exist.  None of the developers think this
should be the default behaviour (I have never heard any dissenters,
feel free to speak out).  The default behaviour is different in more
subtle ways anyway.  The object is to make a usable shell, not one
with every builtin historical limitation.

To more practical matters:  I suggest the test be

        *zsh*) $RM src/_autotst
	    setopt shwordsplit
            $SHELL <<HERE
            O="echo test"
            exec 2>$DEVNULL 1>&2
            \$O && echo test >src/_autotst
HERE

(i.e. with the added setopt line) since it's zsh-specific anyway.
This works in all versions of zsh to implement the sh behaviour.

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



Messages sorted by: Reverse Date, Date, Thread, Author