* Re: is text file?
[not found] <970928170607.ZM7789@candle.brasslantern.com>
@ 1997-09-29 10:25 ` Peter Stephenson
1997-09-29 12:37 ` Zoltan T. Hidvegi
1997-09-29 15:26 ` Bart Schaefer
0 siblings, 2 replies; 3+ messages in thread
From: Peter Stephenson @ 1997-09-29 10:25 UTC (permalink / raw)
To: Zsh hackers list
"Bart Schaefer" wrote:
> % ls **/*~*(${~${(j/|/)fignore}})(.)
>
> (Somebody tell me why the extra ${~...} is needed in that expression.)
The `|' needs to be tokenised. Otherwise, it looks for the pattern
'.o|~|.pro|.dvi' or whatever as a literal file name. Since the string
required by j is just that, a string not a pattern, it is untokenised
when used to join the array.
Or do you mean, why can't I put the ~ in the same ${...}, in which case,
at least in 3.0.5 and 3.1.2, I think you can.
% echo *(${(j/|/)~fignore})
Makefile~ builtin.c~ builtin.o ...
I think Zoltan has recently updated the substitution code, though.
(Or did you mean, why doesn't it go between the { and the (, in which
case the answer is `it just doesn't, but maybe it should say so in
the manual'.)
--
Peter Stephenson <pws@ifh.de> Tel: +49 33762 77366
WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, Platanenallee 6, 15738 Zeuthen, Germany.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: is text file?
1997-09-29 10:25 ` is text file? Peter Stephenson
@ 1997-09-29 12:37 ` Zoltan T. Hidvegi
1997-09-29 15:26 ` Bart Schaefer
1 sibling, 0 replies; 3+ messages in thread
From: Zoltan T. Hidvegi @ 1997-09-29 12:37 UTC (permalink / raw)
To: Peter Stephenson; +Cc: zsh-workers
Peter Stephenson wrote:
> Or do you mean, why can't I put the ~ in the same ${...}, in which case,
> at least in 3.0.5 and 3.1.2, I think you can.
>
> % echo *(${(j/|/)~fignore})
> Makefile~ builtin.c~ builtin.o ...
Yes, this always worked I think.
> (Or did you mean, why doesn't it go between the { and the (, in which
> case the answer is `it just doesn't, but maybe it should say so in
> the manual'.)
The manual says: if the opening brace is immediately followed by an opening
parenthesis... So it is clear, that the tilde must come after the closing
parenthesis.
Zoli
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: is text file?
1997-09-29 10:25 ` is text file? Peter Stephenson
1997-09-29 12:37 ` Zoltan T. Hidvegi
@ 1997-09-29 15:26 ` Bart Schaefer
1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1997-09-29 15:26 UTC (permalink / raw)
To: Zsh hackers list
On Sep 29, 12:25pm, Peter Stephenson wrote:
} Subject: Re: is text file?
}
} "Bart Schaefer" wrote:
} > % ls **/*~*(${~${(j/|/)fignore}})(.)
} >
} > (Somebody tell me why the extra ${~...} is needed in that expression.)
}
} The `|' needs to be tokenised. Otherwise, it looks for the pattern
} '.o|~|.pro|.dvi' or whatever as a literal file name.
That was the answer I wanted, thanks.
} Or do you mean, why can't I put the ~ in the same ${...}
I would have asked that in a separate message to zsh-workers, but I figured
out
} % echo *(${(j/|/)~fignore})
shortly after I'd sent the previous message.
} (Or did you mean, why doesn't it go between the { and the (, in which
} case the answer is `it just doesn't, but maybe it should say so in
} the manual'.)
In spite of Zoltan's response to this, I don't think it would hurt for the
manual to make an explicit statements about mixing ${( with ${~ ${= etc.,
particularly because of things like ${(j//)#foo} -ne ${#{$(j//)foo}}.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-09-29 15:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <970928170607.ZM7789@candle.brasslantern.com>
1997-09-29 10:25 ` is text file? Peter Stephenson
1997-09-29 12:37 ` Zoltan T. Hidvegi
1997-09-29 15:26 ` Bart Schaefer
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).