bug-bash
[Top][All Lists]
Advanced

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

Re: Comparison failure


From: Pierre Gaston
Subject: Re: Comparison failure
Date: Thu, 10 Jan 2008 16:17:37 +0200

On Jan 10, 2008 3:13 PM, Frans de Boer <address@hidden> wrote:
> To: address@hidden
> Subject: Comparison failure
>
> Following is a function which fails constantly. The function is being
> called by other functions but the result is nowadays always this failure
> on the compare function. Sometimes it went wrong when the number was
> three (2) in this example it is 6. This has worked before with another
> version of bash.
> ++ [[ 5 < 54 ]]
>

< = != > inside [[   ]] compares strings not numbers ie [[ 2 < 103 ]] is false

use either [[ 2 -lt 103 ]] or the arithmetic evaluation : (( 2 < 103 ))




reply via email to

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