<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks for the pointer, Dave.</p>
    <p>I have made a note of it. Hopefully my future bash code will be
      better because of it.</p>
    <p>Craig...<br>
    </p>
    <div class="moz-cite-prefix">On 3/3/24 07:33, Dave Hylands wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABi1daFEHA2=sPE+=tf+SnbWR1P7yiz7Tap9Abjkd312HPX_6A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="auto">There are still some things I prefer to use bash
        for rather than Python (usually involving transforming the
        output of a program). But yeah it’s amazing what you can do with
        a well crafted bash script.<br clear="all">
        <br>
        I tend to use trap a lot more in scripts that get used in a more
        production environment.</div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">I’ve also found myself putting the incantation:</div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">`set -Eeuo pipefail` </div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">at the top of all my bash scripts.</div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">This page gives an detailed explanation of most of
        what that means: 
        <div><a
href="https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425?permalink_comment_id=3935570"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425?permalink_comment_id=3935570</a></div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">The -E makes trap statements get inherited by
          shell functions.</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">I find these options to be extremely useful,
          especially in build commands involved by make. Otherwise lots
          of failures were silently being absorbed rather than halting
          the build.</div>
        <div dir="auto"><br>
        </div>
      </div>
      <div dir="auto">Dave Hylands<br>
      </div>
      <div dir="auto">
        <div dir="auto">
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>Peachland, BC, Canada<br>
                <a href="http://www.davehylands.com" target="_blank"
                  moz-do-not-send="true" class="moz-txt-link-freetext">http://www.davehylands.com</a></div>
            </div>
          </div>
        </div>
      </div>
      <div><br>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
    </blockquote>
    <div class="moz-signature">-- <br>
      IPv6 is the future, the future is here<br>
      <a href="ipv6hawaii.org" class="moz-txt-link-freetext">ipv6hawaii.org</a></div>
  </body>
</html>