bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: handling of test == by BASH's POSIX mode


From: Geir Hauge
Subject: Re: handling of test == by BASH's POSIX mode
Date: Sun, 27 May 2012 09:39:43 +0200

2012/5/27 Jon Seymour <address@hidden>:
> 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

[Prev in Thread] Current Thread [Next in Thread]