Timeline for Testing multi-valued exit status (not just success or failure)
Current License: CC BY-SA 4.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 29, 2020 at 17:52 | comment | added | Anthony Geoghegan | @G-ManSays'ReinstateMonica' If I can trust my memory, I was purposely trying to keep my answer simple (in line with that the OP's level of knowledge and what they were looking for). Rather than edit my answer to make it more general, I'll just upvote yours! | |
| Feb 29, 2020 at 2:02 | comment | added | G-Man Says 'Reinstate Monica' |
While this works for three possible control flows (0, 1, and other), it is not extensible — try adding an elif [ $? -eq 2 ]; then branch — and it papers over a flaw in the OP’s code.
|
|
| Jul 15, 2019 at 11:27 | history | answered | Anthony Geoghegan | CC BY-SA 4.0 |