# How can I do this with AWK

1. Sep 16, 2009

### confi999

Hi,
I need to modify a shell script and add the following into it:
location: 200 200 1
location: 200 200 2
location: 200 200 3
---------
---------
---------
location: 200 200 449
location: 200 200 500

I thought using some awk command one could produce the series 1,2,.... 500 in the last column of all the 500 lines. Can anyone help me with that command.
Thank you very much.

2. Sep 16, 2009

### sylas

if you just want a filter to add numbers to the end of each line...

awk '{ print $0, ++x; }' 3. Sep 16, 2009 ### confi999 Hi, Thanks! I want to write a small script or an awk command (or if any other way) that will produce a file which has all those 500 lines in it. 4. Sep 16, 2009 ### sylas Here's a shell script Code (Text): #!/bin/sh for (( n=1 ; n <= 500 ; n++ )) do echo location: 200 200$n
done

5. Sep 16, 2009

### confi999

Thank you sooo much.