Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does set -e command does in Unix?

Tags:

unix

What does the set -e command do in SHELL scripting?

Like the following command:

set -e

Can we do any other things with set -e operation?

like image 330
Kaushik Avatar asked Jan 17 '26 18:01

Kaushik


1 Answers

The 'set' command is used set and examine shell options, as well as set positional parameters.

The -e flag does the following:

  -e  Exit immediately if a command exits with a non-zero status.

Hope this helps :)

like image 141
vxstorm Avatar answered Jan 19 '26 19:01

vxstorm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!