Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a shell script to find the largest number from 3 given
numbers.

Answer Posted / vipul dalwala

In continuation to above answer.

If you want to write a script in more generic way.

if [ $# -eq 0 ]
then
echo "$0: numbers are not given" >&2
exit 1
fi
LARGEST=$(echo $* | xargs -n1 | sort -nr | tail -1)
echo "$LARGEST is largest number"

Is This Answer Correct ?    13 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where are cowrie shells found?

974


I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.

982


How important is shell scripting?

1002


What is @echo off?

947


How do I save a powershell script?

1093


Why are there shells on the beach?

1075


Explain how you Automate your application using Shell scripting.

2265


How to redirect both standard output and standard error to the same location?

1129


is this growing field and what is average package in this?

2260


What are the 3 standard streams in linux?

1070


How do I run a .sh file?

974


Why is a script important?

997


How would you compare the strings in a shell script?

940


Explain about shebang?

997


What is option in shell script?

974