CyberKeeda In Social Media

Bash Addition and Subtraction With Variables.




So we gonna find two integers and store them into two variable, so that we gonna use it further to add or subtract.

For Subtraction you can use

COUNT=`expr $value1 - $value2`

For Addition you can sue

COUNT=`expr $value1 + $value2`

Or you can use it 

SUM=$(( $value1 + $value2 ));

SUB=$(( $value1 -  $value2 ));



No comments:

Post a Comment

Designed By Jackuna