zsh-users
 help / color / mirror / code / Atom feed
* checking for file existence when I don't know the exact name
@ 2011-10-24 13:16 TJ Luoma
  2011-10-24 13:29 ` Jérémie Roquet
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: TJ Luoma @ 2011-10-24 13:16 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-24 15:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-24 13:16 checking for file existence when I don't know the exact name TJ Luoma
2011-10-24 13:29 ` Jérémie Roquet
2011-10-24 14:25   ` TJ Luoma
2011-10-24 14:59     ` Jérémie Roquet
2011-10-24 15:35       ` Peter Stephenson
2011-10-24 13:31 ` Peter Stephenson
2011-10-24 13:41   ` Stephane CHAZELAS
2011-10-24 14:36   ` Vincent Lefevre
2011-10-24 13:35 ` Stephane CHAZELAS

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).