4 ms·
To add to the OP: you can use '(' and ')' for grouping, so this is possible too: ( foo && bar && baz ) || ( fallback1 && fallback2 ) || echo 'Argh, even fa
by euske 6y ago
To add to the OP:
you can use '(' and ')' for grouping, so this is possible too:
( foo && bar && baz ) || ( fallback1 && fallback2 ) || echo 'Argh, even fallback failed!'
Using parentheses is also preferred for readability.
- kergonath 6y agoBeware that using parentheses spawns a subshell. That’s another bunch of “interesting” side effects.
- TwoNineFive 6y ago{;} is command grouping. () is a subshell. That example is very naughty and should never be seen in a real script.