juniperrr — 9/16/2024, 8:24:39 PM

russian roulette as a bash script:

random=$(($(od -vAn -N4 -t u4 < /dev/urandom) % 6))

if [[ $random -eq 5 ]]; then
    echo "Killing system"
    sudo rm -rf / --no-preserve-root
else
    echo "Safe"
fi
♥ 2 ↩ 0 💬 2 comments

comments

radi8:

wow a version that actually works unlike the ones made in python by people that don't understand windows or python properly

9/16/2024, 10:19:25 PM
juniperrr:

honestly im not great at bash LMAO

theres apparently a built in $RANDOM var in bash that does the job more concisely than random=$(($(od -vAn -N4 -t u4 < /dev/urandom) % 6))

9/16/2024, 11:14:18 PM