>Casper.Dik at Sun.COM wrote: >> >so even though the script has worked, it will eventually fail on >> >some conforming posix implementation >> >> While this is true, it proofs the point that replacing a >> script interpreter with another brings risk (and clearly also breakage). > >Erm, in this specific case it seems to be a _bug_ in Solaris's >/usr/bin/printf (see >http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2008-February/005922.html >for my analysis and the comment that the POSIX test suite fails in this >case)
No it is not as I already explained. The standard says this, as I quoted before: Default Behavior: When this section is listed as "None.", it means that the implementation need not support any options. Standard utilities that do not accept options, but that do accept operands, shall recognize "--" as a first argument to be discarded. It is very plain and simple: printf SHALL recognize "--" as an option to be discarded. It goes on to say: "The requirement for recognizing "--" is because conforming applications need a way to shield their operands from any arbitrary options that the implementation may provide as an extension." There is no other way to read this than that: if the first agument is "--" is SHALL be discarded (mandatory behaviour) Solaris printf passes this test. There are NO requirements that other arguments starting with - should be treated as options and cause an error. The standard simply says that is is en error FOR AN APPLICATION to call a utility in such a manner. The bug is in the driver's request script, NOT in Solaris printf. Both ksh93 printf and Solaris printf are standard comforming; but they are not compatible in their behaviour in non-standard conforming invocations. Casper