* Re: globsubst and =command
@ 2000-05-16 12:41 Sven Wischnowsky
2000-05-16 12:58 ` PATCH: " Peter Stephenson
0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-05-16 12:41 UTC (permalink / raw)
To: zsh-workers
Tanaka Akira wrote:
> Z(4):akr@serein% Src/zsh -f
> serein% print -r =ls
> /bin/ls
> serein% a='=ls'
> serein% print -r - $~a
> =ls
> serein%
>
> Since the expansion of =command is kind of filename expansion and ~
> enables filename expansion on the result, I think $~a should be expand
> to /bin/ls. Do I miss something?
I don't think it should do that because it really is something
completely different. But maybe we should change ${(e)foo} to do that
and brace expansion?
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
* PATCH: Re: globsubst and =command
2000-05-16 12:41 globsubst and =command Sven Wischnowsky
@ 2000-05-16 12:58 ` Peter Stephenson
0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2000-05-16 12:58 UTC (permalink / raw)
To: Zsh hackers list
Sven wrote:
> Tanaka Akira wrote:
> > serein% print -r - $~a
> > =ls
> >
> > Since the expansion of =command is kind of filename expansion and ~
> > enables filename expansion on the result, I think $~a should be expand
> > to /bin/ls. Do I miss something?
>
> I don't think it should do that because it really is something
> completely different.
$~a does do ~dir expansion (that's where the ~ originally came from, before
it ever tokenized the rest of the pattern), which is performed at the same
time as =cmd expansion, so it is a little odd. The real issue is that `='
don't get tokenized by on-the-fly tokenization. This patch would do that.
But if you can think of a good reason for not...?
Index: Src/glob.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/glob.c,v
retrieving revision 1.5
diff -u -r1.5 glob.c
--- Src/glob.c 2000/04/30 17:58:35 1.5
+++ Src/glob.c 2000/05/16 12:56:28
@@ -2395,6 +2395,7 @@
case ']':
case '*':
case '?':
+ case '=':
for (t = ztokens; *t; t++)
if (*t == *s) {
if (bslash)
--
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070
^ permalink raw reply [flat|nested] 3+ messages in thread
* globsubst and =command
@ 2000-05-15 23:09 Tanaka Akira
0 siblings, 0 replies; 3+ messages in thread
From: Tanaka Akira @ 2000-05-15 23:09 UTC (permalink / raw)
To: zsh-workers
Z(4):akr@serein% Src/zsh -f
serein% print -r =ls
/bin/ls
serein% a='=ls'
serein% print -r - $~a
=ls
serein%
Since the expansion of =command is kind of filename expansion and ~
enables filename expansion on the result, I think $~a should be expand
to /bin/ls. Do I miss something?
--
Tanaka Akira
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-05-16 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-16 12:41 globsubst and =command Sven Wischnowsky
2000-05-16 12:58 ` PATCH: " Peter Stephenson
-- strict thread matches above, loose matches on Subject: below --
2000-05-15 23:09 Tanaka Akira
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).