1832831 Members
3118 Online
110047 Solutions
New Discussion

Re: list numbers

 
SOLVED
Go to solution
Matthew_50
Valued Contributor

list numbers

Dear All,

I have saw a thread in this forum that I could do like this,

for i in `xxx 1 9`
do
echo $i
done
1 2 3 4 5 6 7 8 9

I forgot what command is xxx, anyone knows it ? Thank you.
3 REPLIES 3
Ralph Grothe
Honored Contributor
Solution

Re: list numbers

You probably have seen the seq command.
You usually find it on Linux systems.
I'm afraid to my knowing HP-UX doesn't provide this.
You either google for a download
(it must be OpenSource) or you implement your own seq() shell function which shouldn't be too difficult.
As a workround I usually use a while loop like such

typeset -i i=0;while (( i <= 10 ));do echo $i;((i+=1));done

Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: list numbers

I just checked on a Linux box in my vicinity.
Actually seq is part of the coreutils package
which sounds very rudimentary.

$ uname -srv
Linux 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003

$ rpm -qf $(which seq)
coreutils-4.5.3-19
Madness, thy name is system administration
Matthew_50
Valued Contributor

Re: list numbers

thanks, thru...system admins always lazy to keystroke the repeat things:-)