To answer your question lucid, bash does have all sorts of cool conditional functions. File test operators ->
http://tldp.org/LDP/abs/html/fto.htmlif [ -e /var/log/auth.log ]; then
cat /dev/null > /var/log/auth.log
fi
Edit: Since we're on the topic of bash, I thought I would drop a couple gems.
$! = last pid launched - good for killing programs launched in the background(&)
tor & # launch it
kill $! # kill it
$? - status of last command.
ifconfig eth0 hw ether IN:VA:LI:DM:AC:AD # this command WILL fail
if [ $? -gt 0 ]; then # if it fails, spit out a msg
echo "MAC change failed."
fi
$$ - pid of the script currently running
$# - number of arguments passed to the script
Also, redirect operators are nice. Look into those for sure. Use them with stdin, stdout, stderr, and /dev/null to control where your data goes.