Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. i hate bash scripts so much ​​

i hate bash scripts so much ​​

Scheduled Pinned Locked Moved Uncategorized
8 Posts 3 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • privateger@plasmatrap.comP This user is from outside of this forum
    privateger@plasmatrap.comP This user is from outside of this forum
    privateger@plasmatrap.com
    wrote last edited by
    #1

    i hate bash scripts so much ​​

    privateger@plasmatrap.comP 1 Reply Last reply
    0
    • privateger@plasmatrap.comP privateger@plasmatrap.com

      i hate bash scripts so much ​​

      privateger@plasmatrap.comP This user is from outside of this forum
      privateger@plasmatrap.comP This user is from outside of this forum
      privateger@plasmatrap.com
      wrote last edited by
      #2

      that entire language needs a replacement. even C has less footguns

      privateger@plasmatrap.comP aliceif@mkultra.x27.oneA 2 Replies Last reply
      0
      • privateger@plasmatrap.comP privateger@plasmatrap.com

        that entire language needs a replacement. even C has less footguns

        privateger@plasmatrap.comP This user is from outside of this forum
        privateger@plasmatrap.comP This user is from outside of this forum
        privateger@plasmatrap.com
        wrote last edited by
        #3

        file="my important file.txt"
        rm $file  # deletes "my", "important", and "file.txt"
        rm "$file"  # correct
        dir=""
        rm -rf "$dir/"  # becomes rm -rf /
        # always have to guard like this
        rm -rf "${dir:?Variable is empty}/"

        privateger@plasmatrap.comP 1 Reply Last reply
        0
        • privateger@plasmatrap.comP privateger@plasmatrap.com

          file="my important file.txt"
          rm $file  # deletes "my", "important", and "file.txt"
          rm "$file"  # correct
          dir=""
          rm -rf "$dir/"  # becomes rm -rf /
          # always have to guard like this
          rm -rf "${dir:?Variable is empty}/"

          privateger@plasmatrap.comP This user is from outside of this forum
          privateger@plasmatrap.comP This user is from outside of this forum
          privateger@plasmatrap.com
          wrote last edited by
          #4

          these two alone are insane enough to warrant not writing bash scripts. genuinely not worth it

          privateger@plasmatrap.comP 1 Reply Last reply
          0
          • privateger@plasmatrap.comP privateger@plasmatrap.com

            these two alone are insane enough to warrant not writing bash scripts. genuinely not worth it

            privateger@plasmatrap.comP This user is from outside of this forum
            privateger@plasmatrap.comP This user is from outside of this forum
            privateger@plasmatrap.com
            wrote last edited by
            #5

            something like nushell does a far better job. clearly the paradigm is not the problem, but bash is

            doskel@masto.doskel.netD 1 Reply Last reply
            0
            • privateger@plasmatrap.comP This user is from outside of this forum
              privateger@plasmatrap.comP This user is from outside of this forum
              privateger@plasmatrap.com
              wrote last edited by
              #6

              @puniko@mk.absturztau.be I genuinely could not think of another language that has equally dangerous footguns, C was the closest one ​​
              That still has gets() in the standard library unless you go C11+

              1 Reply Last reply
              0
              • privateger@plasmatrap.comP privateger@plasmatrap.com

                that entire language needs a replacement. even C has less footguns

                aliceif@mkultra.x27.oneA This user is from outside of this forum
                aliceif@mkultra.x27.oneA This user is from outside of this forum
                aliceif@mkultra.x27.one
                wrote last edited by
                #7
                @privateger@plasmatrap.com powershell
                1 Reply Last reply
                0
                • privateger@plasmatrap.comP privateger@plasmatrap.com

                  something like nushell does a far better job. clearly the paradigm is not the problem, but bash is

                  doskel@masto.doskel.netD This user is from outside of this forum
                  doskel@masto.doskel.netD This user is from outside of this forum
                  doskel@masto.doskel.net
                  wrote last edited by
                  #8

                  @privateger honestly even fish is like a million times better than bash
                  for the latter one though, there is the ol' set -euo pipefail (which also fails if any command in a pipe fails to avoid other undefined behavior) to lessen the sting of Bash

                  1 Reply Last reply
                  1
                  0
                  • R relay@relay.infosec.exchange shared this topic
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups