• 0 Posts
  • 3 Comments
Joined 2 years ago
cake
Cake day: June 22nd, 2024

help-circle
  • Shell footgun. The || only looks at the return value of the preceding command, rm -fr /. There’s an edge case of the command returning a non-zero error code triggering the statement intended to run if, and only if, the condition is false.

    [ 0 -eq 0 ] && { echo "I am in your PCs, deleting your p0rn"; false; } || echo "Lucky you?"
    

    Use if clauses, people. These test abuses do not make one look extra-smart.

    On an unrelated note, I lost on the first try.