handling of test == by BASH's POSIX mode

2012-05-27 Thread Jon Seymour
Is there a reason why bash doesn't treat == as an illegal test operator when running in POSIX mode? 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

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

2012-05-27 Thread Geir Hauge
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

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

2012-05-27 Thread Jon Seymour
On 27/05/2012, at 17:39, Geir Hauge geir.ha...@gmail.com wrote: 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

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

2012-05-27 Thread Dan Douglas
On Sunday, May 27, 2012 08:45:46 PM Jon Seymour wrote: On 27/05/2012, at 17:39, Geir Hauge geir.ha...@gmail.com wrote: 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

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

2012-05-27 Thread Andreas Schwab
Jon Seymour jon.seym...@gmail.com writes: As it stands, I can't use bash's POSIX mode to verify the validity or otherwise of a POSIX script because bash won't report these kinds of errors - even when running in POSIX mode. You can't do that anyway: POSIX mode does not disable proper

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

2012-05-27 Thread Jon Seymour
On Sun, May 27, 2012 at 9:24 PM, Dan Douglas orm...@gmail.com wrote: On Sunday, May 27, 2012 08:45:46 PM Jon Seymour wrote: On 27/05/2012, at 17:39, Geir Hauge geir.ha...@gmail.com wrote: I guess the question is better phrased thus: what use case is usefully served by having bash's POSIX mode

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

2012-05-27 Thread Jon Seymour
On Sun, May 27, 2012 at 9:31 PM, Andreas Schwab sch...@linux-m68k.org wrote: Jon Seymour jon.seym...@gmail.com writes: As it stands, I can't use bash's POSIX mode to verify the validity or otherwise of a POSIX script because bash won't report these kinds of errors - even when running in POSIX

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

2012-05-27 Thread Jon Seymour
On Sun, May 27, 2012 at 11:09 PM, Jon Seymour jon.seym...@gmail.com wrote: On Sun, May 27, 2012 at 9:31 PM, Andreas Schwab sch...@linux-m68k.org wrote: Jon Seymour jon.seymour@gm ** I guess I can except that current bash behaviour is, on balance, except - accept

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

2012-05-27 Thread Dan Douglas
POSIX hasn't provided a way to validate whether a script only uses features that are required to be supported by POSIX compliant interpreters. I believe that was someone else's point, but yes that would be a problem for anyone who wanted to implement compliance check warnings. even if bash

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

2012-05-27 Thread Jon Seymour
On Mon, May 28, 2012 at 2:08 AM, Dan Douglas orm...@gmail.com wrote: ... Bash just modifies conflicting features to the minimal extent necessary to bring it into compliance, which seems to be the path of least resistance. Sure. I understand that this is a reasonable philosophy given that