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

Re: [[ -f file* ]]



On Mon, May 18, 2009 at 5:14 AM, Atom Smasher wrote:
> if i want to test for the presence of one or more files matching a certain
> pattern, it seems non-trivial to do it with the normal "test" or conditional
> expressions.
...
> is there a better way?

Well, off the top of my head, I can think of

[ -n "$(print -- test*(N))" ]

but even that seems inelegant; I'm sure someone can chime in with
something better.

~Matt



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