shell script Command line help please

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

bossman5000

Thread Starter
Joined
Nov 9, 2011
Messages
8
Write a shell script that will accept any number of command line interger parameters do the following....I have to use a if statment for the lowest and highest values???

first question-----Determind the lowest and highest values?
second question------Determind the sum of all parameters entered??



for num in $*

do

if [ num -lt lowest}
then
echo " The low number is : $num"
fi
if { $num -gt high ]
then echo "High num is: $num"
fi

How
 

Squashman

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
You never assign anything to the variables lowest or high. You should probably loop through all your input before you echo the output.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top