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

DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake

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