bug-bash
[Top][All Lists]
Advanced

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

Re: Strange bug in arithmetic function


From: Pierre Gaston
Subject: Re: Strange bug in arithmetic function
Date: Tue, 22 Feb 2011 15:43:10 +0200

On Mon, Feb 21, 2011 at 11:13 AM, Marcel de Reuver <address@hidden>wrote:

> In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if
> the week number is even.
> Only in week 08 the error is: bash: 08: value too great for base
> (error token is "08") the same in week 09, all others are Ok...
>
> GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
> Copyright (C) 2007 Free Software Foundation, Inc.
>
> Running Ubutu 2.6.24-28 server
>
> This is a feature, numbers with a leading 0 are interpreted as octal.
also $[ ] is deprecated, prefer $(( ))


reply via email to

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