13,420
edits
Changes
→Additional Loop Statements
The older method is to use the '''expr''' command. For example:
<prestyle="color:blue;font-weight:bold;font-family:courier;">
num1=5;num2=10
result=$(expr $num1 + $num2)
Example1:
<pre style="color:blue;font-weight:bold;font-family:courier;">
num1=5;num2=10
((result $num1 - $num2))
echo "$num1 - $num2 = $result"
5 - 10 = -5
</pre>
Example2:
<pre style="color:blue;font-weight:bold;font-family:courier;">
num1=5;num2=10
echo "$num1 x $num2 = $((num1 * num2))"
5 x 10 = 50
</pre>
===Using Startup Files===