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

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.  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@xxxxxx>       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.



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