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
How to calculate the number of passed arguments?
how will you find the total disk space used by a specific user?
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
How important is shell scripting?
What is the fastest scripting language?
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.
Write down the syntax for all the loops in shell scripting.
What does path stand for?
What is subshell?
What are the different types of shell scripting?
How do I start a shell script?
What is the equivalent of a file shortcut that we have a window on a linux system?
What is shell chemistry?
Is bash an operating system?