Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
checking for file existence when I don't know the exact name
- X-seq: zsh-users 16534
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: checking for file existence when I don't know the exact name
- Date: Mon, 24 Oct 2011 09:16:21 -0400
- 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=
- 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
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author