i hate bash scripts so much
-
i hate bash scripts so much
-
i hate bash scripts so much
that entire language needs a replacement. even C has less footguns
-
that entire language needs a replacement. even C has less footguns
file="my important file.txt" rm $file # deletes "my", "important", and "file.txt" rm "$file" # correctdir="" rm -rf "$dir/" # becomes rm -rf / # always have to guard like this rm -rf "${dir:?Variable is empty}/" -
file="my important file.txt" rm $file # deletes "my", "important", and "file.txt" rm "$file" # correctdir="" rm -rf "$dir/" # becomes rm -rf / # always have to guard like this rm -rf "${dir:?Variable is empty}/"these two alone are insane enough to warrant not writing bash scripts. genuinely not worth it
-
these two alone are insane enough to warrant not writing bash scripts. genuinely not worth it
something like nushell does a far better job. clearly the paradigm is not the problem, but bash is
-
@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+ -
that entire language needs a replacement. even C has less footguns
@privateger@plasmatrap.com powershell -
something like nushell does a far better job. clearly the paradigm is not the problem, but bash is
@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 -
R relay@relay.infosec.exchange shared this topic