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

Re: globbing in conditional expressions



On Wed, 14 May 2014, Daniel Shahaf wrote:

> Bart Schaefer wrote on Tue, May 13, 2014 at 08:41:17 -0700:
...
> Right, so short-circuiting would only be useful for callers that want to
> know whether a pattern matches a large directory, but don't care about
> having a list of matching filenames.  Does anyone have such a use-case?

I often thought about 'this kind of check' while writing a cron script
to analyze logs.  This often starts with 'do a lot of things, but if
and only if there is a log present in /var/log/..some_pattern...

Of course setting null_glob and doing "for name in /var/log/...pattern..."
will do nearly the same, but enclosing all preliminaries for a set of
files AND their loop together in a clear question for the need to run,
seems preferable to me - so  I second creating '-m' ;-)

Stucki



-- 
Christoph von Stuckrad      * * |nickname |Mail <stucki@xxxxxxxxxxxxxxx> \
Freie Universitaet Berlin   |/_*|'stucki' |Tel(Mo.,Mi.):+49 30 838-75 459|
Mathematik & Informatik EDV |\ *|if online|  (Di,Do,Fr):+49 30 77 39 6600|
Takustr. 9 / 14195 Berlin   * * |on IRCnet|Fax(home):   +49 30 77 39 6601/



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