Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Oct 2005 23:34:54 +0930
From:      Malcolm Kay <malcolm.kay@internode.on.net>
To:        freebsd-questions@freebsd.org
Cc:        Emanuel Strobl <Emanuel.strobl@gmx.net>
Subject:   Re: (bourne)shell variable names containing a variable?
Message-ID:  <200510202334.54410.malcolm.kay@internode.on.net>
In-Reply-To: <200510201517.34489@harrymail>
References:  <200510201517.34489@harrymail>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 20 Oct 2005 10:47 pm, Emanuel Strobl wrote:
> #!/bin/sh
> list=3D"one two three four"
>
> for item in $list; do
> =A0 ${item}_present=3Dyes

  eval ${item}_present=3Dyes

> done

echo $one_present
echo $two_present
echo $three_present
echo $four_present

=3D=3D>

yes
yes
yes
yes


Malcolm Kay



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510202334.54410.malcolm.kay>