11 ms·
If you're not doing `set -euo` and if you run your scripts as root before testing them, you're asking for something wrong to happen. EDIT in response to your E
by linkdd 6y ago
If you're not doing `set -euo` and if you run your scripts as root before testing them, you're asking for something wrong to happen.
EDIT in response to your EDIT:
My users get either:
- a tar.gz archive
- a binary
- a docker image
- an helm chart
- a POSIX shell script (very rare)
Then they can use any method they want to deploy it.
You want your software to be portable? You have to put in the work to do it.
If you expect your users to know better (assume they ARE idiots), again, you're asking for something wrong to happen.
- DonHopkins 6y agoNo, if you're using a language that requires you to perform some obscure incantation like "set -euo" before running your scripts, you're asking for something wrong to happen. Blame the disease, not the symptom.
- dylan604 6y agoif your pedantic enough to use "set -euo", you're going to add it to the script and not make a user set it first.
- dataflow 6y ago> If you're not doing `set -euo` and if you run your scripts as root before testing them, you're asking for something wrong to happen. ...because you can't delete important files unless you're root, right? Subfolders in your home directory are totally OK being deleted? You store your documents so that only root can modify them? And do you know set -e has a ton of its own pitfalls and doesn't save you from this? It's a half-broken mitigation. I don't have energy to keep arguing here, but I would suggest go learning about the pitfalls of Bash and set -e and such.
- dolmen 6y agoYou mean "set -euo pipefail", don't you? You should use more copy/paste. ;)