answersLogoWhite

0

arg_cnt=$#

arg_list=$*

biggest=$1

if [ $arg_cnt -eq 0 ]; then

echo "$RF there should be minimum 1 argument"

exit 1

fi

for each_arg in $arg_list

do

if [ $each_arg -gt $biggest ]; then

biggest=$each_arg

fi

done

echo " Biggest number is : $biggest \n"

exit 0

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao

Add your answer:

Earn +20 pts
Q: Find largest of n numbers using shell programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp