* Re: Parameter Expansion Bug
@ 1996-03-13 22:39 stuart
0 siblings, 0 replies; 3+ messages in thread
From: stuart @ 1996-03-13 22:39 UTC (permalink / raw)
To: Zoltan Hidvegi, Eskandar Ensafi; +Cc: zsh-workers
i think im in the wring group. is this for the zshell prgram for the TI-85
calculator? itrs by hagander. is this the wronbg group???
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Parameter Expansion Bug
1996-03-13 20:04 Eskandar Ensafi
@ 1996-03-13 20:57 ` Zoltan Hidvegi
0 siblings, 0 replies; 3+ messages in thread
From: Zoltan Hidvegi @ 1996-03-13 20:57 UTC (permalink / raw)
To: Eskandar Ensafi; +Cc: zsh-workers
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Parameter Expansion Bug
@ 1996-03-13 20:04 Eskandar Ensafi
1996-03-13 20:57 ` Zoltan Hidvegi
0 siblings, 1 reply; 3+ messages in thread
From: Eskandar Ensafi @ 1996-03-13 20:04 UTC (permalink / raw)
To: zsh-workers
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@cs.ucla.edu (ASCII, MIME, NeXT)
School of Medicine http://www.cs.ucla.edu/csd-lanai/fweb/esky
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-03-13 22:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-13 22:39 Parameter Expansion Bug stuart
-- strict thread matches above, loose matches on Subject: below --
1996-03-13 20:04 Eskandar Ensafi
1996-03-13 20:57 ` Zoltan Hidvegi
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).