1834625 Members
3175 Online
110069 Solutions
New Discussion

small script

 
SOLVED
Go to solution
Inter_1
Frequent Advisor

small script


I want to have a script test.sh
that for every 2 different numbers to have the following kind of result
#./test.sh 3 8

3
4
5
6
7
8

Thanks,
Andy
I like to fix things.
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: small script

Well, if you want one, why don't you write one?

#!/usr/bin/sh
typeset -i LO=${1}
typeset -i HI=${2}
while [[ ${LO} -le ${HI} ]]
do
echo "${LO}"
((LO += 1))
done
exit 0

You really should try to do a little on your own before you ask for such a simple script. If you are preparing for a test, don't bother. I have already assigned your grade.
If it ain't broke, I can fix that.
Peter Godron
Honored Contributor
Solution

Re: small script

Andy,
please see your own thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1098581

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.

Hein van den Heuvel
Honored Contributor

Re: small script


>> I want to have a script test.sh
that for every 2 different numbers to have the following kind of result
#./test.sh 3 8


If that's what you really want, then see prior solutions.

However, I don't think that is not really what you want.

What is the real problem you are trying to solve?

Why do you want to use a million dollar solution to provide such a trivial list?

What will the list be used for?

The 'right' answer to your simplistic question depends on the 'real' problem you are trying to solve.

Agreed?
Hein van den Heuvel
HvdH Performance Consulting
Inter_1
Frequent Advisor

Re: small script

Thanks for your time
I like to fix things.