LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] scripting

[ILUG] scripting

Alister Waller Awaller at Staffmail.wit.ie
Mon Mar 29 17:21:07 IST 1999


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




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell