Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing in conditional expressions
- X-seq: zsh-users 18786
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: globbing in conditional expressions
- Date: Thu, 8 May 2014 10:55:22 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; s=mesmtp; bh=DnTmQNjyUr1 4f8QtWTxHhdw+BI8=; b=uBawzbZtWb908/Bt59kPqrJRDiIO6Per5GTitOEe3C9 xT8y0bjVbCM6cq2W0WoDqvhElPEFe8WGh7slVROSxUuBl8mYm4QDO0+OxU/wcw9H 6B9b6yT81QMc2L4efbgvzf6p5fzp3cWcGUlj15k7gUPiRvit9TtP+H63cSYWBhXE =
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=DnTmQNjyUr14f8QtWTxHhdw+BI8=; b=fmHSlsYVtWYuOizQ+soEVBp2iuKY T6g96wflhzzm42hSGhb8kcMTjH14WwY8tG3/ZuV+Xf+gvNcyVqNQ48Kwi28qtNFI LwSQgL8qLrfNeciUrQXiL0DRVKDdvqGy1j/nB4FoEJJTFucIR3FP/PTANXDh9Yzh /StLzVe5VoQTGqo=
- In-reply-to: <20140507154407.660eb500@pwslap01u.europe.root.pri>
- 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: <20140507124101.GA53652@isis.sigpipe.cz> <20140507154407.660eb500@pwslap01u.europe.root.pri>
Peter Stephenson wrote on Wed, May 07, 2014 at 15:44:07 +0100:
> matches=(fubar(N/F))
> [[ -z $matches ]]
All three solutions first set an array to the result of the glob. Is
there a solution that short-circuits, i.e., that returns as soon as a
single matching filename is found?
This matters when the glob is matched against a large number of files.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author