2012/5/27 Jon Seymour <jon.seym...@gmail.com>:
> Is there a reason why bash doesn't treat == as an illegal test
> operator when running in POSIX mode?

POSIX does not say == is not allowed.

POSIX tells you what the shell should at least be able to do. A POSIX
compliant shell can have whatever other features it likes, as long as
the POSIX features are covered.


> This is problematic because use of test == in scripts that should be
> POSIX isn't getting caught when I run them under bash's POSIX mode.
> The scripts then fail when run under dash which seems to be stricter
> about this.

Don't use non-POSIX features in a POSIX script, and you'll be fine.
http://www.opengroup.org/onlinepubs/9699919799/utilities/contents.html

-- 
Geir Hauge

Reply via email to