Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: checking for file existence when I don't know the exact name
- X-seq: zsh-users 16535
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: checking for file existence when I don't know the exact name
- Date: Mon, 24 Oct 2011 15:29:16 +0200
- Cc: TJ Luoma <luomat@xxxxxxxxx>
- 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=
- In-reply-to: <CADjGqHvFLBemKQBcKymqiR3yYp1Bh9r02xCD8SfgdNOqTsudCg@mail.gmail.com>
- 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
- References: <CADjGqHvFLBemKQBcKymqiR3yYp1Bh9r02xCD8SfgdNOqTsudCg@mail.gmail.com>
Hi,
2011/10/24 TJ Luoma <luomat@xxxxxxxxx>:
> 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 sure
> that some setting is enabled?
From the man, section “conditional expressions” :
“File generation is not performed on any form of argument to conditions.”
Best regards,
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author