<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Rabbit-Hole on Institute of Ineptitude</title><link>https://ineptitude.ca/tags/rabbit-hole/</link><description>Recent content in Rabbit-Hole on Institute of Ineptitude</description><generator>Hugo -- 0.153.1</generator><language>en</language><lastBuildDate>Sat, 06 Dec 2025 21:41:18 -0700</lastBuildDate><atom:link href="https://ineptitude.ca/tags/rabbit-hole/index.xml" rel="self" type="application/rss+xml"/><item><title>Condition Evaluation Utility</title><link>https://ineptitude.ca/writing/condition-evaluation-utility/</link><pubDate>Sat, 06 Dec 2025 21:41:18 -0700</pubDate><guid>https://ineptitude.ca/writing/condition-evaluation-utility/</guid><description>&lt;p&gt;After you run a command in UNIX shell (bourne, bash, etc), &lt;code&gt;$?&lt;/code&gt; has
the exit code (return value) of the prior run command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh-session" data-lang="sh-session"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt; $? Expands to the exit status of the most recent pipeline.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Shell scripting is a bit &lt;em&gt;weird&lt;/em&gt; in that the return value of a program
is evaluated as &lt;code&gt;true&lt;/code&gt; if it&amp;rsquo;s &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt; if it&amp;rsquo;s &lt;code&gt;non-zero.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This is useful as by convention unix commands return &lt;code&gt;0&lt;/code&gt; on success
or any other integer code to map to specific error conditions.&lt;/p&gt;</description></item></channel></rss>