| ▲ | archargelod 2 hours ago | ||||||||||||||||||||||
Why take a perfectly readable if-statement and turn it into something, 99.9% of people would need to lookup. Concise != better. You can make it one line with: | |||||||||||||||||||||||
| ▲ | refp an hour ago | parent | next [-] | ||||||||||||||||||||||
This question seems to pop up all over the place, so I took some time to answer it here: https://refp.se/articles/your-shell-and-the-magic-colon#why-... | |||||||||||||||||||||||
| ▲ | tzot 2 hours ago | parent | prev [-] | ||||||||||||||||||||||
I believe you missed a semicolon after `exit 1` and before `}`. `}` closes the opening `{` only at the start of a command (POSIX rules; don't remember now if bash recognizes it when it's just a command argument). | |||||||||||||||||||||||
| |||||||||||||||||||||||