Executive TL;DR:
- The shell colon can be useful for error handling and permission tests.
- It is often used with redirections, but this is not always necessary.
- Some developers prefer alternative methods for achieving similar results.
The Buzz Score:
The Internet’s Verdict: 60% Hyped, 40% Skeptical
Forum Voices:
Developers have mixed opinions about the shell colon. Some find it useful, while others prefer alternative methods.
I am not a huge fan of most of these, but a few do seem useful.
: "${1:?missing argument, aborting!}"
Others point out that the shell colon is not always necessary.
> ( : >> result.json ) && echo YES # is result.json writable? As a go-to idiom for a writability test, it gives me pause.
Conclusion:
In conclusion, the shell colon can be a useful tool for error handling and permission tests, but it is not always necessary and can be replaced with alternative methods.
Focus Keyword: Shell Colon