“Exit traps” can make your Bash scripts more robust and reliable (2013)
&gt;The secret sauce is a pseudo-signal provided by bash, called EXIT, that you can trap; commands or functions trapped on it will execute when the script exits for any reason.<p>&quot;Secret Sauce&quot;, why is this secret at all.<p>Nothing against the author who&#x27;s helping the ecosystem here, but is there an authoritative guide on Bash that anyone can recommend?<p>Hopefully something that&#x27;s portable between Mac &amp; Linux.<p>The web is full of contradictory guides and shellcheck seems to be the last line of defense.<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;koalaman&#x2F;shellcheck">https:&#x2F;&#x2F;github.com&#x2F;koalaman&#x2F;shellcheck</a>