bug-bash
[Top][All Lists]
Advanced

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

Re: arithmetic evaluation (may be error) ?


From: Bob Proulx
Subject: Re: arithmetic evaluation (may be error) ?
Date: Sat, 29 Dec 2007 10:20:38 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

Roman Rumisek wrote:
> $ echo $(("096" & 4))
> bash: "096" & 4: syntax error: operand expected (error token is ""096" & 4")
> $ echo $((0096 & 4))
> bash: 0096: value too great for base (error token is "0096")

In both of those the 9 is not a valid octal component.  You are
running into octal conversion problems.  Please read the Bash FAQ
entry E4 for further details.

> Is it bash error ?

Bash is doing the right thing.

Bob




reply via email to

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