Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: FAQ : how to check for existence of a file ABC*
- X-seq: zsh-users 14826
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: jarausch@xxxxxxxxxxxxxxxxxxx
- Subject: Re: FAQ : how to check for existence of a file ABC*
- Date: Fri, 12 Feb 2010 12:55:52 +0100
- Cc: zsh-users@xxxxxxx
- In-reply-to: <tkrat.d1856a3e314a4383@xxxxxxxxxxxxxxxxxxx> (Helmut Jarausch's message of "Fri, 12 Feb 2010 12:11:48 +0100 (CET)")
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <tkrat.d1856a3e314a4383@xxxxxxxxxxxxxxxxxxx>
Helmut Jarausch wrote:
> sorry if this is a FAQ (I just couldn't find it)
>
> I like to check if there is any file matching a given file pattern
> e.g. XX*
>
> My problem is,
>
> if NULL_GLOB is unset the shell bails out if no such file exists;
> but if NULL_GLOB is set, then the test [[ -f XX* ]] is invalid since
> XX* expands to a null string.
It's a question that comes up every now and then, but I don't think it's
in the FAQ.
Here's an approach using a helper function:
<http://www.zsh.org/mla/users/2009/msg00509.html>
And if you don't want to introduce a function, you may want to use
something along the lines of this:
<http://www.zsh.org/mla/users/2009/msg00512.html>
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author