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

Re: Word splitting with zsh fix



On Sun, Feb 12, 2006 at 05:05:14PM +0200, Roumen Petrov wrote:
> I would like to know if option SH_WORD_SPLIT is set problem is solved
> too?

Can you explain what you mean?  Because your test case works exactly
as it should in zsh:

% ./testcase
V1=v1 v2
V2=v1
V2=v2

(I note that your test case explicitly requested zsh, not bourne-shell
compatibility mode.)

If you wanted the first loop to split VAR on spaces, in zsh you need
to request that (when SH_WORD_SPLIT is not enabled):

for V in ${=VAR}; do
  echo V1=$V
done

..wayne..



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