Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parameter Expansion Bug
- X-seq: zsh-workers 823
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: esky@xxxxxxxxxxx (Eskandar Ensafi)
- Subject: Re: Parameter Expansion Bug
- Date: Wed, 13 Mar 1996 21:57:08 +0100 (MET)
- Cc: zsh-workers@xxxxxxxxxxxxxxx (zsh-workers)
- In-reply-to: <9603132004.AA08513@xxxxxxxxxxxxxxxxxxxx> from "Eskandar Ensafi" at Mar 13, 96 12:04:10 pm
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> 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