5 ms·
Actually POSIX does not recognize double brackets [1]: "The KornShell-derived conditional command (double bracket [[]]) was removed from the shell command lang
by ez77 15y ago
Actually POSIX does not recognize double brackets [1]:
"The KornShell-derived conditional command (double bracket [[]]) was removed from the shell command language description in an early proposal. Objections were raised that the real problem is misuse of the test command ( [), and putting it into the shell is the wrong way to fix the problem. Instead, proper documentation and a new shell reserved word ( !) are sufficient."
The entire section on test is full of advice on the proper use of test(1).
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/te...
- acqq 15y agoThe article writes about Bash and not about POSIX standardization of test command which omits double brackets.
- ez77 15y agoI replied to a specific comment, not to the article. In particular, nescafe said this was "an OK intro to pre-POSIX bourne shell scripting". I took this to mean that he would provide POSIX-endorsed suggestions. The double brackets, at least, are not "post-POSIX".