Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: check for existence without full globbing
- X-seq: zsh-users 5880
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh users list <zsh-users@xxxxxxxxxx>
- Subject: Re: check for existence without full globbing
- Date: Tue, 4 Feb 2003 18:01:24 +0000
- In-reply-to: <20030204093812.GC20304@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030204032905.15019.qmail@xxxxxxxxxxxxxxxxxxxxxxx> <1030204051624.ZM15383@xxxxxxxxxxxxxxxxxxxxxxx> <20030204093812.GC20304@xxxxxx>
On Feb 4, 3:38am, John Buttery wrote:
}
} Just out of curiosity, isn't this a problem that's neatly solved with
} a utility like find(1)?
In this particular instance, I don't know of any way to get find to
descend all directories while reporting the name of each directory that
contains a plain file matching a certain pattern. I'd be happy to be
proved wrong ... but my zsh solution isn't doing that either.
However, in the general case the best answer is: Unless efficiency is an
overriding concern, use whatever utility you're more familiar with.
To use any external utility like `find', you have to fork it and read
its output. That's quite a bit of overhead. If you're going to pipe
the output off to some other external program, or use the result as
arguments to another program, then `find' is fine. If you want to suck
the output back into zsh to do string manipulations, it's probably more
efficient to use a glob in an array assignment.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author