Re:Bash Retry Function with Exponential Backoff
by chubot on Thursday December 29, 2022 @08:22PM
(#34180492)
Yeah it's best to just use POSIX shell arithmetic, and not be clever, and not the other 2 ways bash has to do it! THat is:
i=$((i + 1))
The (( )) construct, without the $, is different, and it's also not POSIX. It has the gotchas around the exit code, which a plain assignment doesn't have.
So this works:
But this doesn't: The relevant doc is for `let`: https://www.gnu.org/software/bash/manual/bash.html#index-let