Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list numbers between $start and $finish 2

Status
Not open for further replies.

columb

IS-IT--Management
Feb 5, 2004
1,231
EU
I know there's a ksh routine to list the numbers between any two arbitrary points but I can't find it. Any answers please.

On the internet no one knows you're a dog

Columb Healy
 
That's the one.
As ever I'm in your debt.


On the internet no one knows you're a dog

Columb Healy
 
What OS is that? I couldnt find the seq command in AIX.


Z
 
You can usually find it on Linux. I wrote this one for Solaris because I liked it so much, however it lacks some of the seq features such as incrementing by something other than 1, etc. You could easily add that of course...

Code:
#!/bin/ksh
# Because there's no 'seq' on Solaris
awk -v START=$1 -v FINISH=$2 'BEGIN { for (i=START; i <= FINISH; i++) { print i } }'


Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top