Arithmetic shell script:
To carry out arithmetic operation on variable have to use the command expression catch is able to carry arithmetic operation.
Ex:
a=10
b=5
echo expression $ a+$b
echo expression $ a/*$b
while evaluating an expression expression perform various arithmetic according to the following priorities.
Four decision making
a) if -then-fi
b)if-then-fi
c)if-max-if-else-fi
d)case-asac
if-then-else if statement
if(control command)
then statement
else statement
if
read number
if($number - &to)
then
echo regestive integer
else
echo positive number
is
No comments:
Post a Comment