3 ms·
I use the shebang "#!/bin/bash -e". To get the same effect as the "set -o errexit -o nounset", I think you can use "#!/bin/bash -e -u". (There seems to be no o
by ArchD 12y ago
I use the shebang "#!/bin/bash -e".
To get the same effect as the "set -o errexit -o nounset", I think you can use "#!/bin/bash -e -u". (There seems to be no option for pipefail.)
- ploxiln 12y agoThe "shebang" treats everything after the binary as a single argument. It only does one argument from the shebang and the file itself as the final argument. So it would run that kinda like bash '-e -u' $file But you can do #!/bin/bash -eu
- yrro 12y agoThis breaks if your script is sourced by another shell. Best use 'set -eu' at the start instead.