View Single Post
Old 03-29-2009, 03:32 AM  
rowan
Too lazy to set a custom title
 
Join Date: Mar 2002
Location: Australia
Posts: 17,393
Maybe something like...

if [ "`ls *.php`X" = "X" ]; then
# no *.php
fi


That may print out an error to stderr if there's no files. Not sure.

I wouldn't use 'locate' since that checks the locate database (which is only rebuilt periodically) rather than looking at actual (current) directory entries.
rowan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote