# capture output so we can display conditionally # also simulate -x manually just for the heck of it echo "+ pip install requests" INSTALL_OUTPUT=$(pip install requests 2>&1) if [[ $? > 0 ]]; then echo "$INSTALL_OUTPUT" exit 1 fi echo "+ python bot.py" python bot.py