Shell Script to Divide Two Numbers on Command Line Full Tutorial For Beginners

 

 

numbers.sh

 

 

#Unix shell script for the division of two numbers

num1=100
num2=20

ans=$((num1 / num2))

echo $ans

 

 

 

#Unix shell script for division of two numbers
#using expr

num1=100
num2=20

ans=`expr $num1 / $num2`

echo $ans

Leave a Reply