On Mon, 4 Mar 2002, Alister Waller wrote:
> What I want is for the script to process the export for each company in the
> companies file and check to see if that companies export flag is set to YES,
> if so do the export, if not then miss it out.

> RRexportflag=yes
> XXexportflag=no
> for i in `cat companies`
> do
> if [ $iexportflag = "yes" ] ; then
> ...do some exporting ...
> fi
> done
> 
> The problem I have is that the $iexportflag becomes RRexportflag and Not the
> value (yes) which is what I want.
> can someone suggest the best way to get this to work?

if [ `eval echo $"${i}exportflag"` == "yes" ] ; then
...

But that's a nasty piece of code.
I really would suggest putting the export flags somewhere other than in
the same file as the script. Even have a seperate file just listing the
companies to export.

-- Jessica Mayo.
(Everything with a Grin :)


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to