2 ms·
> Busybox also seems to include awk. Would that have been a slightly less terrible choice of implementation language, or even worse? Two parts to that - I don'
by shakna 6y ago
> Busybox also seems to include awk. Would that have been a slightly less terrible choice of implementation language, or even worse?
Two parts to that - I don't know awk well enough. I would need to re-implement diff/patch in awk, or make heavy use of sh anyway.
> I was somewhat alarmed for a second there, but at least on bash (version 5.1.4) "set -e" definitely does work inside functions.
The number of _exceptions_ to set -e is actually quite a number:
> If not interactive, exit immediately if any untested command fails. The exit status of a command is considered to be explicitly tested if the command is used to control an if, elif, while, or until; or if the command is the left hand operand of an ''&&'' or ''||'' operator.
set -o pipefail only catches some of those, especially the while and ifs that will continue to standout to blow your foot off... But even more import to note: sh is not bash.
We're talking about POSIX shell. In Busybox's case, it is based on ash. Which doesn't actually have pipefail to begin with.