I am trying to look for 2 files in a directory and if both of them are present, I need to echo "Bravo" else "You lost" but I am getting stuck here. If the 1st file is present and 2nd is not, I am getting "You lost" BUT if 1st file is absent and 2nd file is present I am getting "Bravo". Below is my code. Someone please help me.
find /var/tmp/crontab -name crontest|grep crontest
if [ "$?" eq 0 ]; then
find /var/tmp/crontab -name cronjob|grep cronjob
if [ "$?" -eq 0 ]; then
echo "Bravo"
else
echo "You lost"
fi
fi