Simple Bash syntax error in Steam for Linux executed “rm -rf /*” (2015)
github.com
github.com
Apparently the "fix" only applies to the root user. The article is about a regular user who recursively lost everything he owned starting at /.
Ouch!
[1] https://unix.stackexchange.com/questions/19547/how-far-can-y...
Thanks, it's was interesting to see the difference!
Recursively removing something that starts with a shell variable is stupid.
Oh man, reading that line made me cringe.
I generally just prefer not using Bash scripting, as it's very hard to compose functionality in it.
${STEAMROOT:?}
...where :? throws an error if the variable is unset or empty. (Still far too scary for my taste, though!) set -euo pipefail
as the first thing in your bash script which you absolutely should do every single time.