[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: error in math args?
From: |
Chris F.A. Johnson |
Subject: |
Re: error in math args? |
Date: |
Wed, 30 Nov 2005 11:45:37 -0500 (EST) |
On Wed, 30 Nov 2005, Scott Dylewski wrote:
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.
Numbers with a leading 0 are treated as octal, i.e. base 8; "8"
and "9" are not legitimate octal digits.
[scott@feynman complex]$ echo $(( 008 / 2 ))
-bash: 008: value too great for base (error token is "008")
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)