Date: Wed, 10 Mar 2004 14:22:23 -0800 From: "Jordan K. Hubbard" <jkh@queasyweasel.com> To: freebsd-standards@freebsd.org Subject: Behavior of expr(1) and standards conformance. Message-ID: <672CEF48-72E1-11D8-B113-000393BB9222@queasyweasel.com>
next in thread | raw e-mail | index | archive | help
In the man page for expr(1) on FreeBSD 5.x, we see the following statement: Compatibility with previous implementations Unless FreeBSD 4.x compatibility is enabled, this version of expr adheres to the POSIX Utility Syntax Guidelines, which require that a leading argument beginning with a minus sign be considered an option to the program. I believe this is wrong, however, since the only "standards docs" for expr(1) can find are here: http://www.opengroup.org/onlinepubs/007908799/xcu/expr.html And they say nothing about allowing - arguments, Utility Syntax Guidelines notwithstanding (and "guidelines" are, by definition, not necessarily universally binding). More to the point, The Open Group's UNIX conformance tests expect to be able to do stuff like this: expr -c : '\([+-]\)' And have it return an appropriate error code (0). Under FreeBSD's expr(1), this falls over on its face, and the documentation on the compat hack added to expr seems to strongly imply that it's conformant as it currently stands, the /etc/compat/FreeBSD-4-util hack being what one does to make it non-conformant. I believe this is backwards. Comments? -- Jordan K. Hubbard Engineering Manager, BSD technology group Apple Computer
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?672CEF48-72E1-11D8-B113-000393BB9222>