The Bourne Shell Source Code
This is the source to the original Bourne Shell, shipped in Research UNIX v7. You&#x27;ve probably used GNU Bash, which stands for &quot;Bourne-Again SHell.&quot;<p>The Bourne sh is significant for a few reasons. Primarily, its GNU descendant is now installed on billions of devices.<p>Perhaps of more interest: Bourne&#x27;s sh source code heavily abuses C macros to look and feel like ALGOL-68. This is made more significant because it came before C was standardized: it took real knowledge to abuse <i>that</i> much.<p>While this is C that compiled just fine for the day, and might compile <i>mostly</i> without errors for a compiler with a K&amp;R compatibility mode, it&#x27;s absolutely wild, and is written compensating for some of K&amp;R&#x27;s faults (see how it handles true v. false).<p>I recommend mac.h as a file of particular interest:<p><a href="https:&#x2F;&#x2F;www.tuhs.org&#x2F;cgi-bin&#x2F;utree.pl?file=V7&#x2F;usr&#x2F;src&#x2F;cmd&#x2F;sh&#x2F;mac.h" rel="nofollow">https:&#x2F;&#x2F;www.tuhs.org&#x2F;cgi-bin&#x2F;utree.pl?file=V7&#x2F;usr&#x2F;src&#x2F;cmd&#x2F;sh...</a><p>Bonus points to anyone who understands what these three lines are doing within it:<p><pre><code>     #define LOBYTE 0377
     #define STRIP 0177
     #define QUOTE 0200

</code></pre>
Also of interest:<p>This was specifically the reason that the International Obfuscated C Code Contest was created, started just minutes after seeing Bourne&#x27;s sh for the first time (I&#x27;m sorry for formatting this as code block, but the formatting breaks otherwise):<p><pre><code>     Q: How did the IOCCC get started?
     A: One day (23 March 1984 to be exact), back Larry 
    Bassel and I (Landon Curt Noll) were working for National 
    Semiconductor&#x27;s Genix porting group, we were both in our 
    offices trying to fix some very broken code. Larry had been
    trying to fix a bug in the classic Bourne shell (C code 
    #defined to death to sort of look like Algol) and I had been
    working on the finger program from early BSD (a bug ridden 
    finger implementation to be sure). We happened to both 
    wander (at the same time) out to the hallway in Building 7C 
    to clear our heads.

     We began to compare notes: &#x27;&#x27;You won&#x27;t believe the code
    I am trying to fix&#x27;&#x27;. And: &#x27;&#x27;Well you cannot imagine the 
    brain damage level of the code I&#x27;m trying to fix&#x27;&#x27;. As well 
    as: &#x27;&#x27;It more than bad code, the author really had to try to
    make it this bad!&#x27;&#x27;.

    After a few minutes we wandered back into my office 
    where I posted a flame to net.lang.c inviting people to try 
    and out obfuscate the UN*X source code we had just been 
    working on.</code></pre>