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 <[EMAIL PROTECTED]> wrote: > > To: bug-bash@gnu.org > > 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 ))