The `||` operator is the mirror of `&&` - it runs the next command only if the last one failed. Today you add it and settle how `&&` and `||` combine on one line.
Implement `||` so the next pipeline runs only when the previous one failed, evaluating connectors left to right.
|| runs its right-hand pipeline only if the left one failed (non-zero
status) - the natural fallback: make || echo "build broke", ping -c1 host || notify-down. It short-circuits the opposite way from &&: on success it skips the
right side, since there is nothing to fall back to.
The interesting question is how && and || mix. In the shell they have equal
precedence and associate left to right, so true && echo a || echo b is
read as (true && echo a) || echo b - true succeeds, echo a runs, and because
that succeeded the || echo b is skipped. Implement it exactly that way: walk the
connectors left to right, and at each one decide whether to run the next pipeline
based on the current last status. No precedence table, no parentheses - just a
left-to-right fold, which is what real shells do here.
// || is the complement of &&: run the right side only on failureif (connector == OR && last_status != 0) run_pipeline(right);if (connector == AND && last_status == 0) run_pipeline(right);// walk connectors left to right; each looks at the current last_status