From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26621 invoked by alias); 24 Oct 2011 13:17:17 -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: 16534 Received: (qmail 6748 invoked from network); 24 Oct 2011 13:17:07 -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,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.213.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=sK+in0ZRv6T4qZ/h2+/rFOm+VgSVig+mbW+rj3ILrF4=; b=XQi+tEzEohRMS2FznCVazeRYeENDPj7pBN2XhRD53KKs61f8jF5n1n16KG5EWDEVq6 f2BKVXrmdu5s5YA+90rcUc9aMKpRHXzLPfu2i8Bb54KAjXqAoA8qjTdoXYsb6jkrobNP UgdihTLvUP0qCsz0U7YKlITmKFvXRS5rp2Vxk= MIME-Version: 1.0 From: TJ Luoma Date: Mon, 24 Oct 2011 09:16:21 -0400 Message-ID: Subject: checking for file existence when I don't know the exact name To: Zsh Users Content-Type: multipart/alternative; boundary=bcaec520ef91fb369c04b00b3c88 --bcaec520ef91fb369c04b00b3c88 Content-Type: text/plain; charset=UTF-8 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. I've been using ls | egrep -q "OmniFocus.*\.omnilicense" 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 sure that some setting is enabled? Thanks! TjL --bcaec520ef91fb369c04b00b3c88--