Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Write a shell script to find the largest among the 3 given numbers

Posted By: Volker Fischer     Category: Unix / Linux / Ubuntu     Views: 33168

Write a shell script to find the largest among the 3
given numbers

Code for Write a shell script to find the largest among the 3 given numbers in Unix / Linux / Ubuntu

echo Enter 3  numbers with spaces in between
read a b c
l=$a
if [ $b -gt $l ]
then
l=$b
fi
if [ $c -gt $l ]
then
l=$c
fi
echo Lagest of $a $b $c is $l
  
Share: 



Volker Fischer
Volker Fischer author of Write a shell script to find the largest among the 3 given numbers is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!