bug-bash
[Top][All Lists]
Advanced

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

leading 0 inconsistence?


From: Ralf Goertz
Subject: leading 0 inconsistence?
Date: Sat, 12 Feb 2011 11:57:08 +0100
User-agent: KNode/4.4.9

Hi,

I am wondering what the reasoning might be for this seeming
inconsistence.

> i=08
> if [ $i -lt 9 ] ; then echo ok; fi
ok
> if [ $((i)) -lt 9 ] ; then echo ok; fi
bash: 08: value too great for base (error token is "08")

Why is 08 not tried to be interpreted as octal when *numerically* compared
using test?




reply via email to

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