check absence of file with "passes shell script"

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi,

I want a rule to be executed only if a file in a specific folder and its subfolders (not the matched folder) does not exist.
In Terminal, i can check it with:
find /path/to/file/ -name filename.pdf

How can this command be put in a "passes shell script"- script ?

Thanks for any help.

Graf Wetter
Graf_Wetter
 
Posts: 37
Joined: Thu Aug 25, 2011 7:18 am

Code: Select all
if [ ! -f "/path/to/file" ]; then exit 0; else exit 1; fi
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

a_freyer,
thanks!
The script works great with some modifications for my needs.
That was very helpful, as always …
Graf_Wetter
Graf_Wetter
 
Posts: 37
Joined: Thu Aug 25, 2011 7:18 am


Return to Support