[ILUG] scripting

From: Alister Waller (Awaller at domain Staffmail.wit.ie)
Date: Mon 29 Mar 1999 - 17:21:07 IST


simple question for some but giving me a few problems, considering I
havent done any scripting for a long time.

i have a variable "counter" which I am incrementing each time I read
a line from a file.
The line I read from the file I want to store in a variable name with
the value of counter appended to make it unique. eg "unique$counter"
I just can't seem to get it to read in the variable correctly.

while read aaaaaa
do
unique$counter=$aaaaaa
counter=`expr $counter + 1`
done < /aaa/filename

this is just a snippet.....

If I run the script I get the following
./scriptname: unique0=valueofaaaaaa: command not found
./scriptname: unique1=valueofaaaaaa: command not found

etc etc until EOF

I know it must be something simple and obvious......

alister



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:06 GMT