bug-bash
[Top][All Lists]
Advanced

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

Re: Comparison failure


From: Frans de Boer
Subject: Re: Comparison failure
Date: Thu, 10 Jan 2008 16:34:08 +0100

You where both right. It's the '<' versus -lt. I tend to avoid -lt
because I always run into errors using this. Beside, in previous
versions of Bash it did not give me this problem. But, i will give it a
try in other functions to see if it works now everywhere as expected.
And yes, the use of these comparison tokens is not well documented
either. I have always read the documentation that they where
interchangeable, which is clearly not the case.

Thanks, subject can be closed.
Frans de Boer.


On Thu, 2008-01-10 at 16:17 +0200, Pierre Gaston wrote:
> 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]