What does the `-eu` mean in `#!/bin/bash -eu` at the top of a bash script? (or any of `-abefhkmnptuvxBCHP`)
19
votes
2
answers
22365
views
What does the
eu
mean after #!/bin/bash -eu
at the top of a bash script?
Normally I begin my bash scripts with this [hashbang/shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) :
#!/bin/bash
but I just came across one with
#!/bin/bash -eu
and I have no idea why there is a -eu
there. Reading the man bash
pages doesn't seem to help me, but maybe I'm overlooking something.
---
**Not a duplicate:**
This is not a duplicate of https://unix.stackexchange.com/questions/208112/correct-behavior-of-exit-and-err-traps-when-using-set-eu .
[Quoting @ilkkachu in the comments below this question](https://unix.stackexchange.com/questions/595249/what-does-the-eu-mean-in-bin-bash-eu-at-the-top-of-a-bash-script-or-a#comment1110949_595249) , directly addressing this:
> ...how -e and -u work with regard to traps or anything else is completely unrelated to how they and other single-character options can be given on the command line.
I agree with that. These are separate questions and answers with differing motivations behind them. That question is so different I would never even think to click on it by looking at its title OR its description when trying to understand the answer to my own question here, and the answers are vastly different too.
Asked by Gabriel Staples
(2972 rep)
Jun 26, 2020, 05:42 PM
Last activity: Jun 24, 2025, 11:33 PM
Last activity: Jun 24, 2025, 11:33 PM