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

Re: Parameter Expansion Bug



> The following does not work properly in zsh-2.6-beta12.  Please note that

I cannot reproduce it under beta13-hzoli13.  Note that expansion is quite
buggy in the vanilla version.  I rewrote most of it so I have no idea what
causes this in the old code.

> myhost% foo () { echo "${argv##^-*}" }    # Show only -option arguments.

Probably you wanted "${argv[@]##^-*}" here.  Without [@] array elements are
joined together using $IFS[1] and the result is used with ##.  Alternatively
you can omit the double quotes.

Also use print -r -- instead of echo for testing as echo processes some
options.

> myhost% foo -a -b a f                     # OK. Ouput was -a -b as expected.
> -a -b

No, the expected output is -a -b a f.

Cheers,

Zoltan




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