Published on March 16, 2017 by ProgrammingKnowledge
Want create site? Find Free WordPress Themes and plugins.

For more detailed Tutorial visit –

The Arithmetic expression is 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 expression
we can also use expr command to perform Arithmetic operations on numbers.

echo “Addition = $(expr $number_1 + $number_2 )”

My Website –
My Blog –
My Facebook Page –
Google+ –
Twitter –
Pinterest –
Text Case Converter –
Epoch Timestamp Converter –
Decimal – Binary – Hexadecimal Converter –
8-bit Checksum Calculator –

Did you find apk for android? You can find new Free Android Games and apps.

Leave a Reply

2 Comments on "Shell Scripting Tutorial for Beginners 10 – Perform arithmetic operations"

Notify of

trevor zvidza
trevor zvidza
7 months 5 days ago

can l ask you something

7 months 6 days ago

For more detailed Tutorial visit –