|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
create an array of numbers in awk
Hi ! I try to create an array of a large amount of numbers in increasing order from 1 to 10,000 (or even infinity). Is there an easier way to do that than writing: Code:
split("1,2,3,4,5,6,7,8,9,10,11,12,13,14,..............,10000",numbers,",")Doing something like: Code:
split([1-10000],numbers) Thanks ! |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
I guess you have your reasons, but I don't see the point of an array of sequential numbers. Code:
awk '
BEGIN {
for( i = 1; i <= 10000; i++ )
numbers[i] = i;
} |
| The Following User Says Thank You to agama For This Useful Post: | ||
lucasvs (04-08-2012) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
You're absolutely right !
Thanks agama |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| generate array of random numbers | saboture88 | Programming | 2 | 02-06-2012 07:05 AM |
| Help with printing sorted array of numbers | pawannoel | UNIX for Dummies Questions & Answers | 0 | 05-02-2011 10:21 AM |
| can array store float point numbers | naree | Solaris | 1 | 03-05-2008 05:59 AM |
| i cannot assign float point numbers to an array in solaris | naree | Solaris | 11 | 02-27-2008 03:06 AM |
| create array holding characters from sring then echo array. | rorey_breaker | Shell Programming and Scripting | 5 | 09-28-2007 08:42 AM |
|
|