Earlier quoted context omitted.
Shell and bash are actually excellent at this, but people don't like writing shell scripts. This is just process chaining. Take a look at DJB's or the more modern runit for init toolkits that compose. https://cr.yp.to/daemontools.html http://smarden.org/runit/ Here is a bash function that retries N times: retry() { local n=$1 shift for i in $(seq $n); do "$@" done } retry 5 echo hi Then you can compose with a timeout…
I guess it's a bit like advanced perl5, you need to be taught the "right way" otherwise you pile up overlapping imperative code.
http://www.oilshell.org/blog/2017/01/13.html
Feedback appreciated!