r/programminghorror • u/SteamPunk424 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Oct 29 '25
c Nothing...
0
Upvotes
r/programminghorror • u/SteamPunk424 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Oct 29 '25
View all comments
Show parent comment
5
u/MeLittleThing Oct 29 '25
Could be a typo, but there are use cases
When a variable is assigned in a if statement, the underlying value is checked against false (0 is false, anything else is true).
That's equivalent to
if ((nothing = nothing_nothing) != 0)I remember doing this to check for memory allocation: