bug-bash
[Top][All Lists]
Advanced

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

error in math args?


From: Scott Dylewski
Subject: error in math args?
Date: Wed, 30 Nov 2005 00:36:56 -0800

I'm running Fedora core 3 on an Athlon, and I get the following problem:

I get an error when running:
echo $(( 008 / 2 ))

In my script, however, I'm passing the value as a variable.  when it
gets to 008, I get an error.

see below for my version and such:

address@hidden complex]$ echo $(( 001 / 2 ))
0
address@hidden complex]$ echo $(( 002 / 2 ))
1
address@hidden complex]$ echo $(( 003 / 2 ))
1
address@hidden complex]$ echo $(( 004 / 2 ))
2
address@hidden complex]$ echo $(( 005 / 2 ))
2
address@hidden complex]$ echo $(( 006 / 2 ))
3
address@hidden complex]$ echo $(( 007 / 2 ))
3
address@hidden complex]$ echo $(( 008 / 2 ))
-bash: 008: value too great for base (error token is "008")
address@hidden complex]$ echo $(( 009 / 2 ))
-bash: 009: value too great for base (error token is "009")
address@hidden complex]$ echo $(( 0010 / 2 ))
4
address@hidden complex]$ echo $(( 008 / 2 ))
-bash: 008: value too great for base (error token is "008")
address@hidden complex]$ echo $SHELL
/bin/bash
address@hidden complex]$ rpm -q bash
bash-3.0-18







reply via email to

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