| Advertise on warmetal.nl! Click for more information about advertising here. |
Did you find this website useful? Did I save you a lot of time? |
|
./script.sh: line 101: [[: 09: value too great for base (error token is "09")
The error occurs when you have a integer value that start with a “0” (zero). Bash will interpret that as an octal, which means 08 and 09 are invalid. I got the error by setting the hour in an variable and making an comparison on it:
hour=`date +%H`
You can force bash to read the number as a decimal by putting “10#” in front of it:
hour="10#`date +%H`"
That fixed it.
Discussion