In early weeks of the year date -d "next Wednesday" "+%V" returns a number of the form 01..09 which bash interprets as oktal number (base 8). Instead of stripping the leading zero we explicitly evaluate with base 10 aka decimal in the arithmetic expression now.
Error output before was something like this for example:
08: value too great for base (error token is "08")
In early weeks of the year
date -d "next Wednesday" "+%V"
returns a number of the form 01..09 which bash interprets as oktal number (base 8). Instead of stripping the leading zero we explicitly evaluate with base 10 aka decimal in the arithmetic expression now.Error output before was something like this for example:
Link: https://stackoverflow.com/a/11130324 Link: https://www.gnu.org/software/bash/manual/html_node/Shell-Arithmetic.html