Why doesn't Bash’s ‘set -e’ do what I expected? (2021)
In the 2000s, I was running extensive sets of simulations and data reduction scripts for a scientific experiment, and I was heavy relying on scripts to run the programs, collect the results, and distribute them over several servers. At first I developed those scripts using bash, but I needed to do math and complex iterations over file names and different parameter files, and I continuously stumbled upon weird behaviors and had to rely to hard-to-understand quirks like the ones explained in the article (which bit me more than once!).<p>After a while I stumbled upon scsh [1], which at first didn't impress me because I ran it as an interactive shell, and from this point of view it was really ugly. But then I realized that scsh was primarily meant as a way to run shell <i>scripts</i>, and I immediately felt in love. I had the power of a Scheme interpreter, the ability to easily use mathematical expressions (the awesomeness of Scheme's numerical tower!) and macros, and a very effective way to redirect inputs and outputs and pipe commands that was embedded in the language [2]!<p>In those years I used scsh a lot and developed quite complex scripts using it, it was really a godsend. Unfortunately the program got abandoned around 2006 because it was not trivial to add support for 64-bit architectures. However, while writing this post I've just discovered that somebody has revived the project and enabled 64-bit compilation [3]. I would love to see a revamp! Nowadays I use Python for complex scripts, but it's not the same as a language with native support for redirection and pipes!<p>[1] <a href="https://scsh.net/" rel="nofollow">https://scsh.net/</a><p>[2] <a href="https://scsh.net/docu/html/man-Z-H-3.html#node_chap_2" rel="nofollow">https://scsh.net/docu/html/man-Z-H-3.html#node_chap_2</a><p>[3] <a href="https://github.com/scheme/scsh" rel="nofollow">https://github.com/scheme/scsh</a>