• 0 Posts
  • 18 Comments
Joined 6 months ago
cake
Cake day: December 30th, 2023

help-circle


  • The POSIX standard is more portable. If you are writing scripts for your system, you can use the full features in the main man pages. If you are writing code that you want to run on other Linux systems, maybe with reduced feature sets like a tiny embedded computer or alternates to gnu tools like alpine linux, or even other unixes like the BSDs, you will have a better time if you limit yourself to POSIX-compatible features and options – any POSIX-compatible Unix-like implementation should be able to run POSIX-compliant code.

    This is also why many shell scripts will call #!/bin/sh instead of #!/bin/bash – sh is more likely to be available on tinier systems than bash.

    If you are just writing scripts and commands for your own purposes, or you know they will only be used on full-feature distributions, it’s often simpler and more comfortable to use all of the advanced features available on your system.










  • To reference a movie in common vocabulary is to bring it up in conversation.

    Referencing in programming terms like C refers to assigning a value to a variable. You can re-assign those variables to new values and then de-reference (read) the new value.

    They are conflating the common meaning of reference with the much more obscure programming definition (obscure at least among non-programmers).

    Star wars = “no, I am your father” (reference) Jaws = movie about hunting killer shark (reference) Star wars = movie about hunting killer shark (OP is pretending we can treat movie references like variable references and re-assigns the star wars variable to mean something else) “Hey, have you seen star wars? The movie about hunting a killer shark?” (De-referencing your newly re-assigned variable)






  • Yes, my comment only applies to the shell history in memory. -c clears history immediately, but you can still reload it from disk if you haven’t overwritten that with -w. If you tend to close your terminal windows frequently and rely on the history feature between sessions, it would benefit you to learn about the intricacies of the on-disk copy of history and how its affected by writes, appends, clears, crashes, etc. I tend to leave my terminal windows open a long time and copy any complex commands out to my PKM if I need to save them for future sessions, so I generally try not to rely on .bash_history, but it has saved my bacon on more than one occasion.