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



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