Bash Script BEST Practices You Need to Know, According to Google

Поделиться
HTML-код
  • Опубликовано: 16 янв 2025

Комментарии • 9

  • @dgholstein
    @dgholstein День назад +1

    Bash is awesome and underused! They are fully wrong on, "don't".
    What they missed on this list is, check return codes! Print a meaningful error message and "exit 1" from your script when you can't continue. The same can be said for all programming languages, error check.

  • @thefearlessgeek
    @thefearlessgeek 2 дня назад

    I get limiting shell scripts to 100 lines. But there are popular projects that are thousands of line that are shell scripts at the same time. Neofetch and Distrobox come to mind.
    My script for Void Linux, xbpsman, has 141 lines currently. It's a bash script. I'm considering using zx though, where I can use JavaScript but still do bash commands easily.

  • @ByteBite101
    @ByteBite101 3 дня назад +1

    🔥

  • @drgrdrgrable
    @drgrdrgrable 2 дня назад +1

    ## Fail fast
    set -euo pipefail

  • @richardbray
    @richardbray 3 дня назад +2

    Just tried using embedded newlines without backslashes, totally works, this guy doesn't know what he's talking about.

    • @roeniss
      @roeniss День назад +1

      what shell do you use

  • @trumpetpunk42
    @trumpetpunk42 2 дня назад +2

    How to use bash. Step 1: Dont. 😂