RedditEnjoyer@lemmy.world to Linux@lemmy.ml · 8 months agoA Linux user's nightmare: the machine was wiped clean with one clickwww.mikrobitti.fiexternal-linkmessage-square7fedilinkarrow-up10arrow-down11file-text
arrow-up1-1arrow-down1external-linkA Linux user's nightmare: the machine was wiped clean with one clickwww.mikrobitti.fiRedditEnjoyer@lemmy.world to Linux@lemmy.ml · 8 months agomessage-square7fedilinkfile-text
minus-squaremumblerfish@lemmy.worldlinkfedilinkarrow-up0·8 months agoIs there not also a way to disallow empty variables in the script, I think it is set -u? Then you don’t have to keep thinking “should I add a :? here because if empty it may lead to disaster” all the time. Might be even safer.
minus-squareUnityDevice@startrek.websitelinkfedilinkarrow-up1·8 months agoset -euo pipefail at the top of every script makes stuff a lot safer. Explanation here.
Is there not also a way to disallow empty variables in the script, I think it is
set -u
? Then you don’t have to keep thinking “should I add a:?
here because if empty it may lead to disaster” all the time. Might be even safer.set -euo pipefail
at the top of every script makes stuff a lot safer. Explanation here.