Re: Bug in awk?

From: Bruce Barnett (spamhater113+U051119094427_at_grymoire.com)
Date: 11/19/05


Date: 19 Nov 2005 14:44:32 GMT

Michael Tosch <eedmit@NO.eed.SPAM.ericsson.PLS.se> writes:

> Hi,
>
> In Solaris 9:
>
> echo 123.123.123 | /usr/xpg4/bin/awk '
> $1=="123.123.1"{print $1,"is equal to 123.123.1"}'
> gives
> 123.123.123 is equal to 123.123.1
>
> This does not happen with /bin/awk, /bin/nawk, GNU awk,
> and even not with /usr/xpg4/bin/awk in Solaris 8.
>
> Is this a new POSIX standard, or a bug?

Numerically, 123.123.123 == 123.123

Are you SURE you want to compare these two fields numerically?
I would think you wan to compare them as strings...

-- 
Sending unsolicited commercial e-mail to this account incurs a fee of 
$500 per message, and acknowledges the legality of this contract.


Relevant Pages

  • Re: Bug in awk?
    ... >>Is this a new POSIX standard, or a bug? ... > Are you SURE you want to compare these two fields numerically? ... I want to compare strings, therefore I made a string in quotes. ...
    (comp.unix.shell)
  • Bug in awk?
    ... and even not with /usr/xpg4/bin/awk in Solaris 8. ... Is this a new POSIX standard, or a bug? ... Michael Tosch @ hp: com ...
    (comp.unix.shell)
  • Re: OT: Time to fix bugs?
    ... I am trying to compare the performance of a group of developers against ... are the words 'bug' and 'fix'. ... clearly they're only based on our own environment and user set, ... Sure, within a single set of user processes, and software ...
    (uk.rec.motorcycles)
  • Re: 4GL compares NULL differently
    ... Denis Melnikov said: ... > Solaris 2.6 ... > 4GL must compare NULL to any not-NULL value as FALSE. ... "C'est pas parce qu'on n'a rien ` dire qu'il faut fermer sa gueule" ...
    (comp.databases.informix)
  • Re: 4GL compares NULL differently
    ... > 4GL must compare NULL to any not-NULL value as FALSE. ... including another null, is unknown. ... condition fails and the ELSE clause is taken. ... you have found a bug. ...
    (comp.databases.informix)