Quantcast
Channel: What does 'set -e' mean in a Bash script? - Stack Overflow
Viewing all articles
Browse latest Browse all 13

Answer by Manikandan Raj for What does 'set -e' mean in a Bash script?

$
0
0

Script 1: without setting -e

#!/bin/bashdecho "hi"echo "hello"

This will throw an error in the line with decho and the program continues to the next line.

Script 2: With setting -e

#!/bin/bashset -edecho "hi"echo "hello"

Up to decho "hi", the shell will process and the program exit. It will not proceed further.


Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>