On Mon, Feb 21, 2011 at 04:13:54AM EST, Marcel de Reuver 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...
Due to the prepended zero, bash thinks you are using octal (base 8) numbers. Compare: $ a=$((7+8)) $ echo $a 15 $ a=$((7+08)) $ bash: 08: value too great for base (error token is "08") cj