Renamed `ioccc.ico` to `favicon.ico`. Correctly added use of `favicon.ico` to all constructed HTML headers. Fixed the smart quote in HTML elements problem. Moved HTML "DO NOT EDIT" comments down below at the bottom of the HTML phase 1 section. According to to the Nu Html Checker, a charset attribute on a meta element found after the first 1024 bytes. Changed `bin/md2html.sh` VERSION from "1.1.3 2024-03-28" to "1.2 2024-03-30". Improved `bin/gen-status.sh` to adjust the "status_update" value only when the "contest_status" is changed. Performed a `make www` to perform and test the above under macOS.
349 lines
26 KiB
HTML
349 lines
26 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||
|
||
<!-- END: this line ends content from: inc/top.default.html -->
|
||
<!-- START: this line starts content from: inc/head.default.html -->
|
||
|
||
<head>
|
||
<link rel="stylesheet" href="../../ioccc.css">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>1990/tbr - Best Utility</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="1990 IOCCC entry tbr - Best Utility">
|
||
<meta name="keywords" content="IOCCC, 1990, IOCCC 1990, IOCCC entry, tbr, Best Utility">
|
||
</head>
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- END: this line ends content from: inc/head.default.html -->
|
||
|
||
<!-- -->
|
||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||
<!-- The content of main section of this web page came from: 1990/tbr/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 1990/tbr/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 1990/tbr/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 1990/tbr/README.md !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content from: inc/body.default.html -->
|
||
|
||
<body>
|
||
|
||
<!-- END: this line ends content from: inc/body.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<img src="../../png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>1990/tbr - Best Utility</h2>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||
|
||
<div class="topnav">
|
||
<a class="Left" href="../stig/index.html">← stig</a>
|
||
<a class="Left" href="../index.html">↑ 1990 ↑</a>
|
||
<a class="Left" href="../theorem/index.html">theorem →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/1990/tbr/tbr.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/1990/tbr/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||
|
||
<div class="row">
|
||
|
||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||
|
||
<div class="leftcolumn">
|
||
|
||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||
|
||
<div class="sidenav">
|
||
<a href="#content">Jump to contents</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../index.html">IOCCC Home</a>
|
||
<a href="../../years.html">Winning Entries</a>
|
||
<a href="../../authors.html">People who have won</a>
|
||
<a href="../../location.html">Location of authors</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../news.html">IOCCC News</a>
|
||
<a href="../../status.html">Contest status</a>
|
||
<a href="../../faq.html#submit">How to enter the IOCCC</a>
|
||
<a href="../../faq.html">FAQ</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../bugs.html">Bugs & (mis)features</a>
|
||
<a href="../../faq.html#fix_an_entry">Fixing IOCCC entries</a>
|
||
<a href="../../faq.html#fix_web_site">Fixing the web site</a>
|
||
<a href="../../faq.html#fix_author">Fixing author info</a>
|
||
<a href="../../thanks-for-help.html">Thanks for the help</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../judges.html">The IOCCC Judges</a>
|
||
<a href="../../contact.html">Contacting the IOCCC</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="#top">Jump to top</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||
|
||
<div class="rightcolumn">
|
||
|
||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||
|
||
<a name="content"></a>
|
||
|
||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||
|
||
<h2 id="authors"><a name="author"></a>Authors:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#Byron_Rakitzis">Byron Rakitzis</a><br>
|
||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
|
||
<br><br></li>
|
||
<li>Name: <a href="../../authors.html#Sean_Dorward">Sean Dorward</a><br>
|
||
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
|
||
<br><br></li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
|
||
<h2 id="to-build">To build:</h2>
|
||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
|
||
<p>The authors provided another version of this program. See the <a href="#alternate-code">alternate
|
||
version</a> section below.</p>
|
||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||
<p>The current status of this entry is:</p>
|
||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||
<p>For more detailed information see <a href="../../bugs.html#1990_tbr">1990 tbr bugs</a>.</p>
|
||
<h3 id="a-note-about-the-fixes-of-this-entry-in-2023">A note about the fixes of this entry in 2023:</h3>
|
||
<p>In 2023 it was noticed that in some systems like macOS there was confusing
|
||
output due to a warning at runtime that was interspersed with the output of the
|
||
program. For instance it would show:</p>
|
||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr</span></span>
|
||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> warning: this program uses gets<span class="er">(</span><span class="kw">)</span><span class="ex">,</span> which is unsafe.</span></code></pre></div>
|
||
<p>which kind of hid the prompt. Thus the entry was changed to use <code>fgets(3)</code> which
|
||
is referred to later in this file.</p>
|
||
<p>Also <code>exit(3)</code> returns <code>void</code> but the entry was using it in a binary expression so
|
||
this entry would not compile in modern systems. This fix is also referred to
|
||
below, in the <a href="#alternate-code">alternate version</a> section.</p>
|
||
<h2 id="to-use">To use:</h2>
|
||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr</span></span>
|
||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> enter some shell commands</span></code></pre></div>
|
||
<p>NOTE: globs do not work with this entry. Why?</p>
|
||
<p>NOTE: <code>exit</code> does not work and neither does <code>logout</code>. To exit try sending ctrl-d
|
||
or ctrl-c (or kill it from another terminal :-) ). But why does it not work with
|
||
just <code>exit</code> or <code>logout</code>? Hint: see the authors’ remarks.</p>
|
||
<h2 id="try">Try:</h2>
|
||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr</span></span>
|
||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ls <span class="at">-l</span> tbr tbr.c</span>
|
||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="co"># notice how the following does not work:</span></span>
|
||
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="fu">ls</span> tbr<span class="pp">*</span></span>
|
||
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="co"># try figuring out how this entry works in an editor:</span></span>
|
||
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a><span class="fu">vi</span> tbr.c</span>
|
||
<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a><span class="co"># then figure out how to exit vi :-)</span></span></code></pre></div>
|
||
<p>What happens if you try using <code>cd -</code> to return to previous directory? What about
|
||
<code>cd</code> with no args?</p>
|
||
<p>The authors include a section called <a href="#bugs">BUGS</a> that, because they were
|
||
documented, are not considered bugs as such in the context of the contest.</p>
|
||
<h2 id="alternate-code">Alternate code:</h2>
|
||
<p>The authors supplied us with a slightly smaller unformatted version
|
||
of the program which we include below:</p>
|
||
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define D </span><span class="op">,</span><span class="pp">close</span><span class="op">(</span></span>
|
||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span><span class="op">*</span>c<span class="op">,</span>q<span class="op">[</span><span class="dv">512</span><span class="op">],</span>m<span class="op">[</span><span class="dv">256</span><span class="op">],*</span>v<span class="op">[</span><span class="dv">99</span><span class="op">],**</span>u<span class="op">,*</span>i<span class="op">[</span><span class="dv">3</span><span class="op">];</span><span class="dt">int</span> f<span class="op">[</span><span class="dv">2</span><span class="op">],</span>p<span class="op">;</span>main<span class="op">(){</span><span class="cf">for</span><span class="op">(</span>m<span class="op">[</span>m<span class="op">[</span><span class="dv">60</span><span class="op">]=</span>m<span class="op">[</span><span class="dv">62</span><span class="op">]=</span></span>
|
||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="dv">32</span><span class="op">]=</span>m<span class="op">[*</span>m<span class="op">=</span><span class="dv">124</span><span class="op">[</span>m<span class="op">]=</span><span class="dv">9</span><span class="op">]=</span><span class="dv">6</span><span class="op">;</span>e<span class="op">(-</span><span class="dv">8</span><span class="op">),</span>gets<span class="op">(</span><span class="dv">1</span><span class="op">+(</span>c<span class="op">=</span>q<span class="op">))||(</span>exit<span class="op">(</span><span class="dv">0</span><span class="op">),</span><span class="dv">0</span><span class="op">);</span>r<span class="op">(</span><span class="dv">0</span><span class="op">,</span><span class="dv">0</span><span class="op">))</span><span class="cf">for</span><span class="op">(;*++</span>c<span class="op">;);}</span></span>
|
||
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a>r<span class="op">(</span>t<span class="op">,</span>o<span class="op">){*</span>i<span class="op">=</span>i<span class="op">[</span><span class="dv">2</span><span class="op">]=</span><span class="dv">0</span><span class="op">;</span><span class="cf">for</span><span class="op">(</span>u<span class="op">=</span>v<span class="op">+</span><span class="dv">98</span><span class="op">;</span>m<span class="op">[*--</span>c<span class="op">]^</span><span class="dv">9</span><span class="op">;</span>m<span class="op">[*</span>c<span class="op">]&</span><span class="dv">32</span><span class="op">?</span>i<span class="op">[*</span>c<span class="op">&</span><span class="dv">2</span><span class="op">]=</span></span>
|
||
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="op">*</span>u<span class="op">,</span>u<span class="op">-</span>v<span class="op">^</span><span class="dv">98</span><span class="op">&&++</span>u<span class="op">:</span><span class="dv">3</span><span class="op">)</span><span class="cf">if</span><span class="op">(!</span>m<span class="op">[*</span>c<span class="op">]){</span><span class="cf">for</span><span class="op">(*++</span>c<span class="op">=</span><span class="dv">0</span><span class="op">;!</span>m<span class="op">[*--</span>c<span class="op">];);*--</span>u<span class="op">=</span></span>
|
||
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="op">++</span>c<span class="op">;}</span>u<span class="op">-</span>v<span class="op">^</span><span class="dv">98</span><span class="op">?</span>strcmp<span class="op">(*</span>u<span class="op">,</span><span class="st">"cd"</span><span class="op">)?*</span>c<span class="op">?</span>pipe<span class="op">(</span>f<span class="op">),</span>o<span class="op">=</span>f<span class="op">[</span><span class="dv">1</span><span class="op">]:</span><span class="dv">1</span><span class="op">,(</span>p<span class="op">=</span>fork<span class="op">())?</span>e<span class="op">(</span>p<span class="op">),</span>o<span class="op">?</span></span>
|
||
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a>r<span class="op">(</span>o<span class="op">,</span><span class="dv">0</span><span class="op">)</span>D o<span class="op">)</span>D<span class="op">*</span>f<span class="op">):</span><span class="dv">4</span><span class="op">,</span>wait<span class="op">(</span><span class="dv">0</span><span class="op">):(</span>o<span class="op">?</span>dup2<span class="op">(*</span>f<span class="op">,</span><span class="dv">0</span><span class="op">)</span>D<span class="op">*</span>f<span class="op">)</span>D o<span class="op">):*</span>i<span class="op">?</span><span class="dv">1</span> D</span>
|
||
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a><span class="dv">0</span><span class="op">),</span>e<span class="op">(</span>open<span class="op">(*</span>i<span class="op">,</span><span class="dv">0</span><span class="op">)):</span><span class="dv">5</span><span class="op">,</span>t<span class="op">?</span>dup2<span class="op">(</span>t<span class="op">,</span><span class="dv">1</span><span class="op">)</span>D t<span class="op">):</span>i<span class="op">[</span><span class="dv">2</span><span class="op">]?</span><span class="dv">9</span> D</span>
|
||
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a><span class="dv">1</span><span class="op">),</span>e<span class="op">(</span>creat<span class="op">(</span>i<span class="op">[</span><span class="dv">2</span><span class="op">],</span><span class="dv">438</span><span class="op">)):</span><span class="dv">2</span><span class="op">,</span>e<span class="op">(</span>execvp<span class="op">(*</span>u<span class="op">,</span>u<span class="op">))):</span>e<span class="op">(</span>chdir<span class="op">(</span>u<span class="op">[</span><span class="dv">1</span><span class="op">])*</span><span class="dv">2</span><span class="op">):</span><span class="dv">6</span><span class="op">;}</span></span>
|
||
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a>e<span class="op">(</span>x<span class="op">){</span>x<span class="op"><</span><span class="dv">0</span><span class="op">?</span>write<span class="op">(</span><span class="dv">2</span><span class="op">,</span><span class="st">"?</span><span class="sc">\n</span><span class="st">$ "</span><span class="op">-</span>x<span class="op">/</span><span class="dv">4</span><span class="op">,</span><span class="dv">2</span><span class="op">),</span>x<span class="op">+</span><span class="dv">1</span><span class="op">||(</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">),</span><span class="dv">0</span><span class="op">):</span><span class="dv">5</span><span class="op">;}</span></span></code></pre></div>
|
||
<p>and in the <a href="tbr.alt.c">alternate source</a>. It has the <code>exit()</code> returns <code>void</code> fix
|
||
as well as the <code>gets()</code> to <code>fgets()</code> fix applied to it to make it functionally
|
||
equivalent like the authors intended.</p>
|
||
<h3 id="alternate-build">Alternate build:</h3>
|
||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
|
||
<h3 id="alternate-use">Alternate use:</h3>
|
||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./tbr.alt</span></span></code></pre></div>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>This program touches on a well known Unix utility, the 6th edition Bourne Shell
|
||
(<code>/bin/sh</code>), whose original source was considered to be extremely obfuscated by
|
||
many people (although Steve Bourne might disagree). Did you know that the Bourne
|
||
Shell source was a major inspiration for the formation of the IOCCC back in
|
||
1984?</p>
|
||
<h2 id="authors-remarks">Authors’ remarks:</h2>
|
||
<p>This program is a rudimentary shell. It does I/O redirection, pipes
|
||
and cd. It flags errors on failed <code>chdir()</code>, <code>open()</code>, <code>creat()</code>,
|
||
<code>execvp()</code>, <code>fork()</code> and a few syntax errors.</p>
|
||
<p>This program is obfuscated in a few notable ways: apart from the layout (an
|
||
unformatted (but crunched) version is included for people who want to put this
|
||
through <code>cb</code>) it makes clever use of a <code>write()</code> statement, so that the same statement
|
||
can be used to print errors and the prompt. By calling the error function with
|
||
the value <code>-8</code>, the pointer offset in the expression <code>"?\n$ "-x/4</code> goes from 0
|
||
to 2. Presto! A prompt. For errors with numbers smaller than <code>-4</code> (i.e., UNIX
|
||
system calls) a question mark is printed.</p>
|
||
<p>The error value of <code>chdir()</code> is doubled so that we don’t exit from the parent
|
||
shell on a <code>chdir()</code> error (since <code>e()</code> exits on <code>-1</code> errors only). All other
|
||
system call failures exit since they are from sub-shells.</p>
|
||
<p>Recursion is sneakily employed to avoid a second call to <code>fork()</code>,
|
||
and the line is parsed in a fairly bizarre fashion: backwards. The
|
||
heart of the program, that is, the part which performs all <code>fork()</code>s,
|
||
<code>exec()</code>s, <code>open()</code>s, etc. is ONE C STATEMENT.</p>
|
||
<p>The meta-values array is initialized in a bizarre fashion, and the
|
||
subsequent checks for the <code>'<'</code> and <code>'>'</code> are performed in a single
|
||
statement using a mask, since you know that <code>'>'&2</code> is 0, whereas
|
||
<code>'<'&2</code> is 2. Other such micro-obfuscations abound.</p>
|
||
<p>Finally, it is notable that the code was hacked for minimality. If
|
||
you look at the compressed version, you will be hard-pressed to
|
||
eliminate more than a few characters (we can’t see how to make it
|
||
any smaller!). 550 characters is pretty lean for a shell that does
|
||
this much.</p>
|
||
<h3 id="bugs">BUGS</h3>
|
||
<p>The syntax of the shell has not been fully explored, but if you try
|
||
to redirect in the same direction more than once, only one
|
||
redirection is performed. This is a “feature” of the way the line
|
||
is parsed; a pointer to the stack of arguments is assigned and an
|
||
argument is stolen every time a <code>></code> or <code><</code> is encountered. The
|
||
shell flags an error if no arguments are on the stack. Thus, for
|
||
example:</p>
|
||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> <span class="op">></span> foo <span class="op">></span> bar</span></code></pre></div>
|
||
<p>cats to <code>foo</code>, since it was pushed last, but</p>
|
||
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> <span class="op">></span> <span class="op">></span> foo bar</span></code></pre></div>
|
||
<p>cats to <code>bar</code>, since <code>bar</code> was pushed under <code>foo</code> (remember we’re
|
||
parsing right-left).</p>
|
||
<p>Depending on your flavor of Unix, <code>cd</code> without an argument will
|
||
either produce an error or just do nothing.</p>
|
||
<p>There is just one error message, the question mark, but hey, that’s
|
||
all <code>ed(1)</code> does too.</p>
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<h1 id="inventory-for-1990tbr"><a name="inventory"></a>Inventory for 1990/tbr</h1>
|
||
<p><a href="#top">Jump to top</a></p>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.c">tbr.c</a> - entry source</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.alt.c">tbr.alt.c</a> - alternative source</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/tbr.orig.c">tbr.orig.c</a> - original source</li>
|
||
<li><a href="1990_tbr.tar.bz2">1990_tbr.tar.bz2</a> - download entry</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="index.html">index.html</a> - entry home page</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/README.md">README.md</a> - markdown source for index.html</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/.entry.json">.entry.json</a> - description of entry in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1990/tbr/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||
<li><a href=".path">.path</a> - directory path from top directory</li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||
|
||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<div class="footer">
|
||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||
<p>This file and web page is:</p>
|
||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||
<p>For more information, see:</p>
|
||
<blockquote><a
|
||
href="https://creativecommons.org/licenses/by-sa/4.0/">https://creativecommons.org/licenses/by-sa/4.0/</a></blockquote>
|
||
<h2>Coda</h2>
|
||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1990%2Ftbr%2Findex.html">Nu HTML check this web page</a></p>
|
||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||
|
||
</body>
|
||
</html>
|
||
|
||
<!-- END: this line ends content from: inc/bottom.default.html -->
|