So we have an alias that does:
alias doIt='cd somedir; rm -rf *'
What we want is for the command to fail immediately if, for example, somedir does not exist. This protects us from getting the rm -rf bomb in an inconvienient location.
Is something like this possible? If not, is there another way?:
alias doIt='set -e; cd somedir; rm -rf *'
the
rm -rf *won’t be executed ifcd somedirfails.