From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12520 invoked by alias); 24 Oct 2011 14:42:33 -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: 16539 Received: (qmail 4462 invoked from network); 24 Oct 2011 14:42:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Mon, 24 Oct 2011 16:36:29 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: checking for file existence when I don't know the exact name Message-ID: <20111024143629.GF4313@xvii.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20111024143104.07ab64eb@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20111024143104.07ab64eb@pwslap01u.europe.root.pri> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6194-vl-r44775 (2011-07-13) On 2011-10-24 14:31:04 +0100, Peter Stephenson wrote: > The standard method is along the lines of: > > matchingfiles() { > emulate -L zsh > local -a files > files=(${~*}(N)) > (( ${#files} )) > } Wouldn't this be more efficient with files=(${~*}(N[1]))? -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)