[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:
[scott@feynman complex]$ echo $(( 001 / 2 ))
0
[scott@feynman complex]$ echo $(( 002 / 2 ))
1
[scott@feynman complex]$ echo $(( 003 / 2 ))
1
[scott@feynman complex]$ echo $(( 004 / 2 ))
2
[scott@feynman complex]$ echo $(( 005 / 2 ))
2
[scott@feynman complex]$ echo $(( 006 / 2 ))
3
[scott@feynman complex]$ echo $(( 007 / 2 ))
3
[scott@feynman complex]$ echo $(( 008 / 2 ))
-bash: 008: value too great for base (error token is "008")
[scott@feynman complex]$ echo $(( 009 / 2 ))
-bash: 009: value too great for base (error token is "009")
[scott@feynman complex]$ echo $(( 0010 / 2 ))
4
[scott@feynman complex]$ echo $(( 008 / 2 ))
-bash: 008: value too great for base (error token is "008")
[scott@feynman complex]$ echo $SHELL
/bin/bash
[scott@feynman complex]$ rpm -q bash
bash-3.0-18
- error in math args?,
Scott Dylewski <=