Y u no Mamaleek

  • 0 Posts
  • 20 Comments
Joined 21 days ago
cake
Cake day: November 3rd, 2025

help-circle



  • where in your pipe you got a non-null exit code

    First thing you want is set -e and set -o pipefail. That should report the errors in human-parseable form.

    Second, to capture exit codes from each command/program, you have to run each of them in sequence yourself, connected by pipes that you create via mkfifo — the same way as you would do it in any other programming environment. Bash’s | pipes are just a convenient shorthand for this, so if you want full control, you have to ditch the convenience.



  • In Lisp, at least the Emacs Lisp with which I have experience, it’s customary to put in nil (Lisp’s null) for any omitted arguments in the middle that you can’t be arsed to specify — aside from just leaving off arguments at the end. In JS, typing in undefined in every such case would probably be an annoyance, so I’m guessing coders need to check for both undefined and null in these circumstances.

    Overall, it’s remarkable how Lisp teaches one to be much more relaxed about programming practices than is typical for mainstream languages. Design patterns? Data structures? Shit, just pass in a list or an assoc array, and maybe a function here and there. Also everything is an expression, enjoy your ternary (if) at any point anywhere.



  • Functions are definitely not subshells in Bash, seeing as anything modifying the environment, like pyenv and such, is implemented as functions instead of scripts — specifically because functions are run in the same shell instance.

    Unless ‘subshell’ means something in the vein of ‘like a new shell, but not really’.