-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Martin Knapp-Cordes on 10/21/2008 8:31 AM: > Hello, > > I would like to respond to any earlier claim made that > there is a "long-standing bug in matlab startup script". > We at the MathWorks disagree.
Unfortunately, your disagreement is due to your misinterpretation of POSIX. > > Please observe the following by reading carefully > the online documentation for the Open Group Standard, > UNIX Version 3, expr command. The POSIX standard is > subsumed under this standard. (IEEE Std 1003.1, 2004 > edition) > > http://www.unix.org/version3 > > You will have to sign in to look at the standard. Several members of this list are also members of the Austin Group, responsible for the very pages you are quoting. In particular: > > 1. There are NO options allowed in the expr command. > 2. A string argument is an argument that cannot be identified > as an integer argument or as one of the expression > operator symbols ... http://www.opengroup.org/onlinepubs/009695399/utilities/expr.html "Also note that this volume of IEEE Std 1003.1-2001 permits implementations to extend utilities. The expr utility permits the integer arguments to be preceded with a unary minus. This means that an integer argument could look like an option. Therefore, the conforming application must employ the "--" construct of Guideline 10 of the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines to protect its operands if there is any chance the first operand might be a negative integer (or any string with a leading minus)." > "many scripts out there assume that "expr -1 + 1" evaluates to > zero." And coreutils has been patched, so that the next version will once again restore this behavior, AS AN EXTENSION to POSIX (since no POSIX-conforming app will ever invoke expr in this manner). > > This is NOT an assumption. It is the REQUIRED behavior in > order to be a STANDARD conforming shell script. No, the standard REQUIRES that an application support -- as an argument separator for all except a small set of exceptions (think echo), and expr is not in the set of exceptions. It also REQUIRES that compliant apps use - -- if they are passing an argument that might be interpreted as an option by someone that extends the standard. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkj+JzgACgkQ84KuGfSFAYAPUwCfRyQkYBCqWFDNndcpCnx/Sesz yCoAoKoa4qOB9XXSVXqmbBaUXVn8iYvX =4Yva -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils