What's wrong with this?

for i in $companies; do
        process ...
done

?

PS: I'm sure someone is going to try to make a buck by putting all the SLUG
bash questions in an exam that you have to sit for ...

(just kidding)

- Jill.

-- 
Jill Rowling, Systems Administrator
Eng. Systems Dept, Aristocrat Technologies Australia
Level 2, 55 Mentmore Ave Rosebery NSW 2018
Phone: (02) 9697-4484 Fax: (02) 9663-1412 Email: [EMAIL PROTECTED]
 


-----Original Message-----
From: Alister Waller [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 13 June 2002 12:39
To: [EMAIL PROTECTED]
Subject: [SLUG] bash script function


I have a global variable
companies="A B C D E"

i have a call to a function that is

import_data companies

in my function I have

import_data()
{

for i in $1
do

process etc etc

done

}

this makes $1 become the word companies
Whats the syntax to make $1 become $companies and therefore substitute A B C
D E.


----------------------
CONFIDENTIALITY NOTICE
----------------------
This email is intended only to be read or used by the addressee.
The information contained in this e-mail message may be confidential
information. If you are not the intended recipient, any use, interference
with, distribution, disclosure or copying of this material is unauthorised
and prohibited. Confidentiality attached to this communication is not waived
or lost by reason of the mistaken delivery to you.

If you have received this message in error, please delete it and notify us
by return e-mail or telephone Aristocrat Technologies Australia Pty Limited
on +61 2 9413 6300.
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to