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
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!