23 ms·
Oil looks interesting. The documentation is compelling. I sleep at night by writing stoic bash. If I encounter anything unexpected in a script I don’t try to
by gorgoiler 6y ago
Oil looks interesting. The documentation is compelling.
I sleep at night by writing stoic bash. If I encounter anything unexpected in a script I don’t try to handle it, I just report it and then crash.
Most of the bash contortions I’ve seen in my life happen when people (myself included) have tried to handle error conditions or ill specified inputs, gracefully.
A bash script is like a pre-flight checklist: a list of things that should work to get something going. Most bash scripts are like this: in general they are sequences of commands to change the system from one good state to another, not to recover it from a bad state.
In the analogy: if something is not ok with your aircraft it’s beyond the scope of the pre flight check to fix it. Don’t use the checklist as a way of trying to automatically detect what the error is in order to fix it.
- waynesonfire 6y agoGreat analogy. This is exactly how I use bash and have never thought to articulate it this way.