Force exit status if file not found

Sergio Belkin sebelk at gmail.com
Mon Mar 7 22:08:15 UTC 2011


Hi,
I am writing a script that it searchs for a file. I'd want to exit
with status non-zero if the file is not found. But find cannot do
that.
find command only exit with status non-zero one file is not processed
successfully.

locate command con do that, but it cannot find a file from a given directory.

How can I do it?

Thanks in advance!
-- 
--
Sergio Belkin  http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
LPIC-2 Certified - http://www.lpi.org


More information about the users mailing list