Equivalent to let command in POSIX shell

Hi all,

I am learning POSIX shell programming, and the book I read, uses the let command for integer arithmetic.

I have downloaded and use the shellcheck program on Linux.

This programs says:

In POSIX sh, 'let' is undefined.

See the screenshot attached.

What is the POSIX equivalent of let, for doing arithmetic operations, like:

let "x=x+5"

Thank you a lot.

The POSIX equivalent is:

x=$((x+5))
4 Likes