The Arithmetic expression is a very important feature for performing number arithmetic operations in scripts.
By default, variables are treated as strings in bash scripts.
But parsing a string to numbers is very easy using double parentheses and external command such as expr.
Arithmetic operations in Bash Shell
Arithmetic operations can be done on integers using the following methods
$(( expression ))
echo "Addition = $(( number_1 + number_2 ))"
expr — evaluate the expression
we can also use expr command to perform Arithmetic operations on numbers.
echo "Addition = $(expr $number_1 + $number_2 )"
Nesta página do site você pode assistir ao vídeo on-line 10. Shell Scripting Tutorial for Beginners - Perform Arithmetic Operations duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário MyShadowbook Programmer 06 Setembro 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 95 vezes e gostou 3 espectadores. Boa visualização!