Tony Green was once rumoured to have said:
> On Mon, 2002-03-04 at 14:07, Antony Stace wrote:
> > >
> > > 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.
> >
> > you might want to try using "==" (equality check) instead of "="(assignment)
> >
>
> I don't think this is the problem the poster is having.
>
> From what I understand, he wants to use an anonymous variable and I
> don't think you can do that with shell.
>
> You might have to look at doing this another way (case statement?)
Actually,:
if eval [ "\${${i}exportflag" = "yes" ]; then
....
will work.
Yes. I know thats a disgusting hack.
C.
--
--==============================================--
Crossfire | This email was brought to you
[EMAIL PROTECTED] | on 100% Recycled Electrons
--==============================================--
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug