New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bash script mode #805
Comments
we shouldn't encourage people to think turning on https://mywiki.wooledge.org/BashFAQ/105
pipefail can be a little insidious. consider tools that exit early like might be worthwhile adding an appendix on these options and why we don't require them all the time. |
The errexit option ( More I think about it, not exiting on error only makes sens for an interactive use of Bash, but not for a script. But it is indeed probably not always a good idea to set this option when the script is used. But during the development phase at least it is highly useful imo. You’re right for the pipefail option. I don’t think it is as important as the errexit and nounset options. The nounset ( Thank you for your answers. |
Hi,
Simple question about style guide for Bash:
Is there a reason not to recommend what’s usually called “Bash strict mode”? (I’d call it “Bash script mode” myself)
Which is the fact of writing any Bash script with those four settings (declared in the top of the file):
It implies to change a few habits one may have, but I find this very useful once used to.
A detailed explanation: http://redsymbol.net/articles/unofficial-bash-strict-mode/
The text was updated successfully, but these errors were encountered: