13 comments

  • fyredge11 minutes ago
    I disagree on the premise that the author is &quot;using&quot; shell. Often when reading about why the command line &#x2F; shell is better than GUI, the salient advantage comes down to one thing, scripting. Yet scripting in an IDE, which is a GUI, is a ton easier than in vim, simply because the surface for discovery of actions is much more transparent.<p>If scripting were to be excluded, the belittling of GUIs falls a bit flat. I&#x27;d like to see graphic design work be done via CLI.
  • necovek4 hours ago
    I was pretty close in guessing what they believe was &quot;wrong&quot; (or really, superfluous) with their initial shell script example.<p>I&#x27;d even drop the &quot;if&quot; from their footnote version, and go with simply<p><pre><code> npm install || (echo &quot;boom&quot; &amp;&amp; exit) </code></pre> (Not exactly equivalent because there won&#x27;t be an &quot;exit&quot; if echo fails, but it&#x27;s my preferred instict over &quot;;&quot;) Also, &quot;(&quot; starts a subshell, if we are being pedantic.
    • Sharlin1 hour ago
      I wonder if there’s some obscure syntax for &quot;do this if the preceding command fails and propagate its exit code&quot;. For just returning <i>some</i> error you can of course have something like `die(&quot;boom&quot;)` (though not as a builtin?) but sometimes it’s useful to know the exact code.
      • dasyatidprime44 minutes ago
        if table --warble farble; then :; else table_ec=$?; echo &quot;Garble warble farble! :(&quot; &gt;&amp;2; exit $table_ec; fi<p>Works in dash&#x2F;bash&#x2F;zsh at least; not 100% sure whether the behavior of $? on the command in an if test is mandated by POSIX and&#x2F;or portable. Note that you can&#x27;t replace the empty then-branch with a negated condition because the negation also eats the return code.<p>Also, <i>absolutely</i> correct propagation is essentially impossible (but usually not useful anyway), because some errors might be unexpected signal exits or inability to find the command in the first place, and those will get punned onto other nonzero exit codes. I forget the exact conventions OTTOMH but generally they&#x27;re in the high half (≥128).
  • Sharlin1 hour ago
    There is, of course, a programming language designed to do shelly things as succinctly as a shell script: Perl.
    • sourdecor58 minutes ago
      Also Scsh[0].<p>[0]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Scsh" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Scsh</a>
    • disgruntledphd21 hour ago
      I was amused to see DeepSeek using it recently, as I didn&#x27;t realize it was installed on my machine (macos with brew).<p>Ruby is much, much prettier for similar purposes though, and so that&#x27;s what I&#x27;ll learn if I ever need to do this more frequently.
  • carra4 hours ago
    I was sure this article would be about how we tell computers to do things now (writing prompts to an AI in plain English). I was wrong. Interesting nonetheless.
    • ozgung1 hour ago
      LLMs solved this exact problem. Not perfectly (they can sneak in some malicious commands) but good enough for everyone. This is also mostly what non-developers mean by &quot;vibe-coding&quot;. They can &quot;tell the computer to do the things&quot; they want. Previously they were limited to existing GUI applications. Now they can automate and customize their workflows as they wish and think they&#x27;re a &#x27;coder&#x27;.
  • necovek4 hours ago
    On the higher level question in the article of why do people not use their main languages for basic file and command management?<p>I believe the answer is the same as to why Python remains hugely popular despite all the well-documented shortcomings: <i>batteries included</i>.<p>Shell languages include so many neat and concise ways to execute commands, deal with their input, output and exit codes, allow simple traversal of deep directory structures with globs and advanced tools like &#x27;find&#x27; or &#x27;xargs&#x27;, that everything else is very unergonomic.<p>And niche by default (until it gets used widely enough), so even your LANG-OF-CHOICE-expert you recruit, they will not know a thing about that shell-focused library in LANG-OF-CHOICE.
  • ccapitalK5 hours ago
    TIL that the duckdb REPL supports reading json files (<a href="https:&#x2F;&#x2F;duckdb.org&#x2F;docs&#x2F;current&#x2F;data&#x2F;json&#x2F;overview" rel="nofollow">https:&#x2F;&#x2F;duckdb.org&#x2F;docs&#x2F;current&#x2F;data&#x2F;json&#x2F;overview</a>). This might actually be useful the next time I need to investigate a massive json file (`jq` can only go so far).
    • rw_panic0_01 hour ago
      in what case jq, a specialized json tool, is more limiting than sql?
  • ZeroDayDreamer3 hours ago
    That philosophical point about what it even means to &quot;tell a computer to do things&quot; is a good one. Sure, clicking around in a GUI is also telling the computer what to do. But there&#x27;s a huge difference between using someone else&#x27;s abstraction and building your own from scratch. The article is about that second part - the ability to throw stuff together however you want. With a GUI, you&#x27;re stuck with whatever the designer thought of. With a shell, you can build just about anything
    • kalx2 hours ago
      But you’re still limited by the designer of that shell? Or userspace? Or kernel? Or cpu architecture? I mean, how deep should you go before «it’s however YOU want»?
      • ryuuseijin1 hour ago
        There are some really powerful UIs that are extremely flexible, like spreadsheets, or ComfyUI, or certain issue trackers. On the whole however I would say they all still are mostly their own interaction silos and integrations with other programs have to be explicitly built for each app.<p>The great thing about a shell is that you can glue together programs that don&#x27;t know about each other. This is not a silver bullet, with shell programs being text oriented etc., but it does give rise to some powerful possibilities that don&#x27;t really work with UIs.
  • weikju5 hours ago
    Nice article about actually learning stuff and putting this knowledge to use together. Not with AI but with one’s own brain.
  • jeremyjh4 hours ago
    Good advice. I&#x27;ve gotten a ton of utility out of my shell without learning very many tools particularly well.<p>If you take nothing else away from this, memorize the syntax of one-liner for loops, it has saved me so many times.
  • applfanboysbgon2 hours ago
    Your next homework assignment is to write your own scripting language that emits asm. Then you&#x27;ll be one step closer to understanding what it really means to tell your computer to do things!
  • altmanaltman4 hours ago
    Why are we assuming using the terminal is the only way of &quot;telling a computer to do things&quot;? Every way you interact with a machine, you are telling it to do things in theory.<p>For example<p>&gt; At a fundamental level, I wasn’t able to tell my computer to accomplish anything that involved logic or stitching together multiple programs<p>How can that be true if you are telling it to boot on into a os? It doesn&#x27;t involve logic? Or stiching together multiple programs?<p>Using a shell =\= telling a machine what to do on a broad level. You are just using the abstractions provided by the os. If you mean get better at shell so you can use it more efficiently than okay cool but that doesn&#x27;t someone who uses a GUI doesn&#x27;t &quot;tell&quot; the machine what to do as much as you.
  • aldricarchive3 hours ago
    [flagged]