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

Re: array prepend



On Thu, Jan 17, 2013 at 09:52:01AM -0500, Greg Klanderman wrote:
> Ahh OK, I see when SHWORDSPLIT is on, VAR+=$x does not perform
> splitting on $x but VAR+=($x) does.
> 
Looks like when SHWORDSPLIT is on, both VAR+=$x and VAR+=($x) will
perform splitting on $x:

    localhost% setopt shwordsplit
    localhost% setopt
    interactive
    monitor
    norcs
    shinstdin
    shwordsplit
    zle
    localhost% array=(foo bar);v="xxx yyy";array+=$v;print -l $array
    foo
    bar
    xxx
    yyy
    localhost% array=(foo bar);v="xxx yyy";array+=($v);print -l $array
    foo
    bar
    xxx
    yyy
    localhost%



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