SyntaxFix
Write A Post
Hire A Developer
Questions
See ARITHMETIC EVALUATION in man bash:
man bash
Constants with a leading 0 are interpreted as octal numbers.
You can remove the leading zero by parameter expansion:
hour=${hour#0}
or force base-10 interpretation:
$((10#$hour + 1))