• NeatNit@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    Took me a while to understand what you’re warning against. Allow me to rephrase, and tell me if I got it wrong.

    The || will execute what’s after it in two cases:

    1. The preceding command (in this case the rm) never ran because of an earlier &&
    2. The preceding command ran and returned nonzero

    OP’s code relies on the 1 case, but wrongly assumed that the 2 case will never happen. That’s the footgun.