what is the use of set -e inside shell script

BharathKumarRaju DasaraRaju
BharathKumarRaju DasaraRaju used Ask the Experts™
on
What set -e dose in this shell script.

set -e



#!/usr/bin/env sh

ANSIBLE_ROOT=${ANSIBLE_ROOT:-~/ansible}
scl enable python27 bash <<!
set -e
export https_proxy=https://10.198.140.122:8080
if [ ! -d "$ANSIBLE_ROOT/bin" ]
then
    virtualenv "$ANSIBLE_ROOT"
    . "$ANSIBLE_ROOT/bin/activate"
    echo "Installing latest version of ansible"
    pip install ansible -i https://artifactory.global.raju.com/artif4actory/api/pypi/pypi-release/simple
    pip install docker-py -i https://artifactory.global.raju.com/artifactory/api/pypi/pypi-release/simple
    pip install docker-compose==1.15.0 -i https://artifactory.global.raju.com/artifactory/api/pypi/pypi-release/simple
    deactivate
fi
!

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ozo
Most Valuable Expert 2014
Top Expert 2015
Commented:
man sh
...
       set [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]
       set [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...]
...
              -e      Exit immediately if a simple command (see SHELL GRAMMAR above) exits with a non-zero status.
Junior Linux Engineer
Commented:
Exit immediately if a command exits with a non-zero status"

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial