bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] How to ensure string comparison?


From: arnold
Subject: Re: [bug-gawk] How to ensure string comparison?
Date: Wed, 02 Nov 2016 21:07:14 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Peng Yu <address@hidden> wrote:

> Hi, I want to make sure string comparison is used for the second case.
> Is there a way to do so in awk?
>
> /tmp$ awk 'BEGIN { print ("10" > "2" )}'
> 0
> /tmp$ printf '%s\t%s\n' 10 2 | awk '{print ($1>$2) }'
> 1
>
> -- 
> Regards,
> Peng

        printf '%s\t%s\n' 10 2 | awk '{ print ($1 "" > $2 "") }'

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]