Fixing: 08: value too great for base (error token is "08")
Bash script displays an error similar to:
08: value too great for base (error token is "08")
The is attempting to do a calculation like
$item = $item - 1 and
$item is a string value - in this case "08". This can be a result of trying to get the month using a date function. i.e.
item = $(date +%m)
Explicitly state the base of a number using base#number so the item is 8 rather that 08.
item = $(date +%m) item = $((10#$item))
item = $((10#$(date +%m)))
Enjoyed this article?
Thank you for reading this article! If you found the information valuable and enjoyed your time here, consider supporting my work by buying me a coffee. Your contribution helps fuel more content like this. Cheers to shared knowledge and caffeine-fueled inspiration!
Originally published at https://chrisshennan.com/blog/fixing-08-value-too-great-for-base-error-token-is-08