Is there a linux bash command like the java try catch finally? Or does the linux shell always go on?
try { `executeCommandWhichCanFail` mv output } catch {
mv takes two parameters, so may be you really wanted to cat the output file's contents:
mv
echo `{ execCommand && cat output ; } || cat log` rm -f tmp