Hacker News new | ask | show | jobs
by ez77 5219 days 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/te...

1 comments

The article writes about Bash and not about POSIX standardization of test command which omits double brackets.
I 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".