From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16255 invoked by alias); 24 Oct 2011 13:29:50 -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: 16535 Received: (qmail 18494 invoked from network); 24 Oct 2011 13:29:38 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.82.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=2svOHcvfFHfToWiRNRUbLiJAwNV/A/lXRyiIVraZoDQ=; b=fX1Ne6Joj6pJ0gTDJkQsp+hGr1ySi14A6dDml+4XHY5v//kMofV9lXkeaV+oST+YV3 h9TrD5wzT5BGDO31LDZtoVG36sIjxYqPffFL6ecc7MWYzEa8/Okf9v+Sd9KGNwwEC1Es Pdg2/ai+jXJ77KrgFAzOO9W6XEkXrbrjxcHQA= MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Mon, 24 Oct 2011 15:29:16 +0200 Message-ID: Subject: Re: checking for file existence when I don't know the exact name To: Zsh Users Cc: TJ Luoma Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, 2011/10/24 TJ Luoma : > I want to check to see if a file exists that matches this pattern: > > OmniFocus-XXXXX.omnilicense > > where XXXXX is some set of numbers of an unknown length. > > but it occurs to me that I might be able to use [[ -e ]] > > However, I'm not sure what the syntax is. I tried: > > if [[ -e "OmniFocus.*.omnilicense" ]] > then > > {take action here} > > fi > > but that did not work. Do I have the syntax wrong or do I need to make su= re > that some setting is enabled? >>From the man, section =E2=80=9Cconditional expressions=E2=80=9D : =E2=80=9CFile generation is not performed on any form of argument to cond= itions.=E2=80=9D Best regards, --=20 J=C3=A9r=C3=A9mie