<story><title>The Beauty of Unix Pipelines</title><url>https://prithu.xyz/posts/unix-pipeline/</url></story><parent_chain><item><author>gorgoiler</author><text>Pipes are wonderful!  In my opinion you can’t extol them by themselves.  One has to bask in a fuller set of features that are so much greater than the sum of their parts, to feel the warmth of Unix:&lt;p&gt;(1) everything is &lt;i&gt;text&lt;/i&gt;&lt;p&gt;(2) everything (ish) is a &lt;i&gt;file&lt;/i&gt;&lt;p&gt;(3) including &lt;i&gt;pipes&lt;/i&gt; and &lt;i&gt;fds&lt;/i&gt;&lt;p&gt;(4) every piece of software is accessible as a file, invoked at the &lt;i&gt;command line&lt;/i&gt;&lt;p&gt;(5) ...with local &lt;i&gt;arguments&lt;/i&gt;&lt;p&gt;(6) ...and persistent globals in the &lt;i&gt;environment&lt;/i&gt;&lt;p&gt;A lot of understanding comes once you know what execve does, though such knowledge is of course not necessary.  It just helps.&lt;p&gt;Unix is seriously uncool with young people at the moment.  I intend to turn that around and articles like this offer good material.</text></item></parent_chain><comment><author>jcranmer</author><text>&amp;gt; (1) everything is text&lt;p&gt;And lists are space-separated. Unless you want them to be newline-separated, or NUL-separated, which is controlled by an option that may or may not be present for the command you&amp;#x27;re invoking, and is spelled completely differently for each program. Or maybe you just quote spaces somehow, and good luck figuring out who is responsible for inserting quotes and who is responsible for removing them.</text></comment>
<story><title>The Beauty of Unix Pipelines</title><url>https://prithu.xyz/posts/unix-pipeline/</url></story><parent_chain><item><author>gorgoiler</author><text>Pipes are wonderful!  In my opinion you can’t extol them by themselves.  One has to bask in a fuller set of features that are so much greater than the sum of their parts, to feel the warmth of Unix:&lt;p&gt;(1) everything is &lt;i&gt;text&lt;/i&gt;&lt;p&gt;(2) everything (ish) is a &lt;i&gt;file&lt;/i&gt;&lt;p&gt;(3) including &lt;i&gt;pipes&lt;/i&gt; and &lt;i&gt;fds&lt;/i&gt;&lt;p&gt;(4) every piece of software is accessible as a file, invoked at the &lt;i&gt;command line&lt;/i&gt;&lt;p&gt;(5) ...with local &lt;i&gt;arguments&lt;/i&gt;&lt;p&gt;(6) ...and persistent globals in the &lt;i&gt;environment&lt;/i&gt;&lt;p&gt;A lot of understanding comes once you know what execve does, though such knowledge is of course not necessary.  It just helps.&lt;p&gt;Unix is seriously uncool with young people at the moment.  I intend to turn that around and articles like this offer good material.</text></item></parent_chain><comment><author>laumars</author><text>&amp;gt; &lt;i&gt;everything is text&lt;/i&gt;&lt;p&gt;Everything is a byte stream. Usually that means text but sometimes it doesn&amp;#x27;t. Which means you can do fun stuff like:&lt;p&gt;- copy file systems over a network: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.oracle.com&amp;#x2F;cd&amp;#x2F;E18752_01&amp;#x2F;html&amp;#x2F;819-5461&amp;#x2F;gbchx.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.oracle.com&amp;#x2F;cd&amp;#x2F;E18752_01&amp;#x2F;html&amp;#x2F;819-5461&amp;#x2F;gbchx.htm...&lt;/a&gt;&lt;p&gt;- stream a file into gzip&lt;p&gt;- backup or restore an SD card using `cat`</text></comment>