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
Where are cowrie shells found?
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.
How important is shell scripting?
What is @echo off?
How do I save a powershell script?
Why are there shells on the beach?
Explain how you Automate your application using Shell scripting.
How to redirect both standard output and standard error to the same location?
is this growing field and what is average package in this?
What are the 3 standard streams in linux?
How do I run a .sh file?
Why is a script important?
How would you compare the strings in a shell script?
Explain about shebang?
What is option in shell script?