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

Parameter Expansion Bug



Hello,

The following does not work properly in zsh-2.6-beta12.  Please note that
the results are unpredicatable and may change from trial to trial.  If you
want to reproduce it, define foo () as shown below and keep typing "foo a b"
until you get different results.  I am using EXTENDED_GLOB.


myhost% foo () { echo "${argv##^-*}" }    # Show only -option arguments.
myhost% foo a b                           # OK. No output as expected.

myhost% foo a b	                          # Wrong! Should not echo "a b".
a b
myhost% foo a b                           # OK again.

myhost% foo a b                           # Wrong again.
a b
myhost% foo a b                           # Wrong again.
a b
myhost% foo a b                           # OK again.

myhost% foo -a -b a f                     # OK. Ouput was -a -b as expected.
-a -b
myhost% foo a b                           # Say what?
-a -
myhost% foo a b                           # Huh?
a @
myhost% foo a b                           # And now it's OK again!

...


Any idea what's causing this?

- Eskandar

------------------------------------------------------------------------------
Eskandar Ensafi                              Object-Oriented Software Engineer
University of California, Los Angeles                                         
Department of Biomathematics              esky@xxxxxxxxxxx (ASCII, MIME, NeXT)
School of Medicine                  http://www.cs.ucla.edu/csd-lanai/fweb/esky
------------------------------------------------------------------------------




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