From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24911 invoked by alias); 8 May 2014 11:03:55 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18786 Received: (qmail 15657 invoked from network); 8 May 2014 11:03:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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= X-Sasl-enc: tniraY1/+U5gUCBiaMduhzotlc1HuwJr1X9Z7F5mzKn5 1399546526 Date: Thu, 8 May 2014 10:55:22 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: Re: globbing in conditional expressions Message-ID: <20140508105522.GE2052@tarsus.local2> References: <20140507124101.GA53652@isis.sigpipe.cz> <20140507154407.660eb500@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140507154407.660eb500@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.21 (2010-09-15) 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.