Yes, exit status won't do it here. A slightly messy indirect way would be to count the number of lines (matches) that find outputs:
Code:
if test `find . -name $filename | wc -l` -gt 0; then
echo yes
else
echo no
fi
However, if it's just a simple file existence test that you're after, bash has built-in conditional operators to do this:
Code:
if [ -e $filename ]; then
echo yes
else
echo no
fi
There are several such operators (see
man bash for more).