15

Is there any difference between using:

set -e
set -o errexit

From the bash man page it states they are the same and the only difference I can see is that from the user perspective the second format is more explicit.

davidcrossey
  • 586
  • 3
  • 13

1 Answers1

15

You're correct. set -o <option> is the generic way to set various options, and set -e is the shortcut for the errexit option. They have the same effect.

There are a number of shortcuts like this, as the man page indicates. set -u for set -o nounset is another commonly used option.

Ben
  • 1,571
  • 1
  • 13
  • 29