Replace all [ condition ] && action with if-then-fi for some shells treat those incorrectly with 'set -e'