Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: check for existence without full globbing
- X-seq: zsh-users 5867
- 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 02:49:20 +0000
- In-reply-to: <20030203212419.33206.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030203212419.33206.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
On Feb 3, 4:24pm, Le Wang wrote:
}
} I wonder if there is a way to check if a glob pattern can be matched
} without getting all files that can be globbed, i.e. a function that
} return true after the first match is found.
Out of curiosity, why?
It can be done, but it requires forking a subshell, which may not make
it any faster than just generating the list of files to begin with:
if ( : *(Ne:exit 0:) ; exit 1 )
then
print There are some files in this directory
else
print There are no files in this directory
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author