Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

checking for file existence when I don't know the exact name



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