10. Shell Scripting Tutorial for Beginners - Perform Arithmetic Operations

Publicado el: 06 septiembre 2017
en el canal de: MyShadowbook Programmer
95
3

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 )"


En esta página del sitio puede ver el video en línea 10. Shell Scripting Tutorial for Beginners - Perform Arithmetic Operations de Duración hora minuto segunda en buena calidad , que subió el usuario MyShadowbook Programmer 06 septiembre 2017, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 95 veces y le gustó 3 a los espectadores. Disfruta viendo!