++ operation in shell script

Test script

#! sh

num=0

echo $num
num=$(($num + 1))
echo $num
num=$((num + 1))
echo $num
let num++
echo $num
Execution result
❯ ./test.sh          
0
1
2
3

No comments:

Lognote - My toy project

In a project, the code work is limited When I say, "I think it will work if I change it like this," I get, "If it doesn't...