Script to generate a list of number


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to generate a list of number
# 1  
Old 03-18-2010
Question Script to generate a list of number

How can I generate a list of numbers and place all of these numbers in a line-by-line into a file.
I am new to scripting actually.

0501000000 to 0509999999
i.e.
0501000000
0501000001
......
0509999999

set 02
0551000000 to 0559999999
i.e.
0551000000
0551000001
......
0559999999

Please help.

Last edited by noo; 03-18-2010 at 05:43 AM..
# 2  
Old 03-18-2010
Homework? If not, where's the question, and what have you tried so far?
# 3  
Old 03-18-2010
sorry for the mistake. I have edited and help is relly required.
# 4  
Old 03-18-2010
If you post homework, at least be smart enough not to post it from an university computer. The forum for homework is here, Special Rules apply.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with generate a pair of random number

Hi, Is anybody experience generate a pair of random number by using awk command? I wanna to generate a pair of random number (range from 1 to 4124) and repeats it 416 times. Desired output 2 326 123 1256 341 14 3245 645 . . . I did write the below command: awk... (5 Replies)
Discussion started by: perl_beginner
5 Replies

2. UNIX for Dummies Questions & Answers

how to generate random number as as the first column of a txt file

Dear all, I have a question. I have a txt file say 4000 rows X 1800 Column. I 'd like to creat a new column as the first column which is a column of random numbers (n=4000) thanks a lot! Lin (2 Replies)
Discussion started by: forevertl
2 Replies

3. Shell Programming and Scripting

Unix random number generate in given range

Hi All, I have extracted some report from database for few activities done. Now I have a requirement to add some random time(In range of 10-35) in front of each activity. Can be generated random numbers in any bash/sh shell within a given number range, let's say in between 10-30. ... (10 Replies)
Discussion started by: gr8_usk
10 Replies

4. Programming

Generate random number

I saw this formula to generate random number between two specified values in shell script.the following. $(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)) Give a example in book. Generate random number between 6 and 30.like this. $(((RANDOM%30/3+1)*3)) But I have a... (1 Reply)
Discussion started by: luoluo
1 Replies

5. Shell Programming and Scripting

How to generate the list?

Reference post, https://www.unix.com/shell-programming-scripting/131307-incrementing-twist-please-help.html , I can generate a word list easily, by echo or for loop. For example, with the echo command and word expect, I can list all 6 letters possibility (6X6X6X6X6X6=46656) echo... (6 Replies)
Discussion started by: rdcwayx
6 Replies

6. Shell Programming and Scripting

AWK: generate new line number

Hi. I have a script wich reads 1 file and generates 4. If the original file has 10 lines the the sum of the 4 generated files must have the 10 original lines. So far this works. Now what I need is to numerate the lines wtithin each generated file. I tried with NR but it prints the line... (2 Replies)
Discussion started by: mrodrig
2 Replies

7. Shell Programming and Scripting

generate random number in perl

Could any one tell how can I generate random number from (0, 100..200) in perl? Thanks! (2 Replies)
Discussion started by: zx1106
2 Replies

8. Shell Programming and Scripting

how to generate a random list from a given list

Dear Masters, Is there an easy way to generate a random list from a give list of names? Let's say, I have a file containing 15000 city name of world(spreadsheet, names in the first column), I would like to randomly pick up 50 cities each time for total 1000 picks. Or doesn't anyone know a... (3 Replies)
Discussion started by: mskcc
3 Replies

9. Shell Programming and Scripting

generate random number in korn shell

I want to be able to generate a random number within a korn shell script.. Preferably i would like to be able to state how many digits should be in this random number... ie 4 digits or 5 digits etc Any ideas? (2 Replies)
Discussion started by: frustrated1
2 Replies

10. Programming

How to generate a random number?

How to generate a random integer with specific range(for example, from 1 to 1000)? Also, how to convert a floating point number into a integer? (2 Replies)
Discussion started by: MacMonster
2 Replies
Login or Register to Ask a Question