<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Fundamentals on Lost in IT | Kromg</title><link>https://kromg.github.io/tags/fundamentals/</link><description>Recent content in Fundamentals on Lost in IT | Kromg</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 07 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://kromg.github.io/tags/fundamentals/index.xml" rel="self" type="application/rss+xml"/><item><title>The if Statement Secret: It Checks Exit Status, Not Booleans</title><link>https://kromg.github.io/posts/the-if-statement-secret-it-checks-exit-status-not-booleans/</link><pubDate>Tue, 07 Apr 2026 00:00:00 +0000</pubDate><guid>https://kromg.github.io/posts/the-if-statement-secret-it-checks-exit-status-not-booleans/</guid><description>&lt;p&gt;Coming from almost any other programming language, you&amp;rsquo;d expect &lt;code&gt;if&lt;/code&gt; to work on boolean expressions. You write something that evaluates to true or false, and the &lt;code&gt;if&lt;/code&gt; decides which branch to take.&lt;/p&gt;
&lt;p&gt;Bash works in a way that is almost, but not quite, entirely unlike that.&lt;/p&gt;
&lt;p&gt;In Bash, &lt;code&gt;if&lt;/code&gt; runs a command and checks its &lt;em&gt;exit status&lt;/em&gt;. Zero means success (the &amp;ldquo;then&amp;rdquo; branch runs). Non-zero means failure (the &amp;ldquo;else&amp;rdquo; branch runs, if present).&lt;/p&gt;</description></item></channel></rss>