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