What does set -e mean in a Bash script?

Image courtesy Gabriel Heinzer on Unsplash.

If you’ve seen Bash scripts before, you might have come across set -e. It could look a little something like this:

#!/bin/bashset -ecity="Hawkins"
state="Indiana"
echo "I live in $city, $state."

What does that even mean?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tremaine Eto

Tremaine Eto

Senior Software Engineer @ Iterable | Previously worked at DIRECTV, AT&T, and Tinder | UCLA Computer Science alumni | Follow me for software engineering tips!