Is there any other setting i.e Built in variables. or any other setting that affects how the string "000" is converted to 0 automatically in windows and not in Unix.
Cannot recall, but ....... CONVFMT is somewhat related, but I could not get it working as expected.
Here's another scenario:
BEGIN {
VOID="Y"
A="000"
if ( (VOID == "Y") && (A == 0) )
print "YES"
else
print "NO"
}
The above outputs "NO" for awk, nawk, /usr/xpg4/bin/awk and gawk [on Solaris].
BEGIN {
VOID="Y"
A=000
if ( (VOID == "Y") && (A == 0) )
print "YES"
else
print "NO"
}
The above outputs "YES" for all the awk's mentioned above.
This is somewhat strange, but doing 'man nawk' on Solaris:
Based on my examples, it seems like under Solaris the "context" of yje comparision is defined by the type of the LEFT expression.
Actually I just tried the same test under MKS's awk on Windows and does work the SAME as it does on Solaris. And also it behaves the same under Cygwin's awk and gawk under Windows as well - well, at least for the test scenarios I've outlined above.