Changes

Jump to: navigation, search

Tutorial12: Shell Scripting - Part 2

44 bytes removed, 09:53, 29 December 2020
Additional Loop Statements
The older method is to use the '''expr''' command. For example:
<pre style="color:blue;font-weight:bold;font-family:courier;">
num1=5;num2=10
result=$(expr $num1 + $num2)
Example:
<pre style="color:blue;font-weight:bold;font-family:courier;">
num1=5;num2=10
((result $num1 - $num2))
Alternative Example:
<pre style="color:blue;font-weight:bold;font-family:courier;">
num1=5;num2=10
echo "$num1 x $num2 = $((num1 * num2))"
Example using a Loop:
<pre style="color:blue;font-weight:bold;font-family:courier;">
value=1
while [ $value -le 5 ]
13,420
edits

Navigation menu