[BusyBox] ash variable dereference
Steve Wahl
swahl at brecis.com
Thu Aug 8 09:24:03 UTC 2002
On Thu, Aug 08, 2002 at 04:38:21PM +0200, Rolland Dudemaine wrote:
> Hello there,
>
> I have two separated questions :
>
> 1) Is there a way to do a double dereferencing of variables (like {!$a}
> in bash) in ash :
> example :
> # i is a value iterated
> i=12
> # v will contain the name of the variable to dereference
> v=ITEM$i
> # this is working in both bash and ash, but is darn slow
> result=`sh -c 'echo -n $'"$v"`
>
> I have not found another way to do that, and when checking a dozens
> values, it is becoming to take some time launching as many shells as
> dereferences...
You mean like this?
$ ITEM12=HereItIs
$ i=12
$ v=ITEM$i
$ eval result=\$$v
$ echo $result
HereItIs
$
--> Steve Wahl
P.S. I have no idea about the sed question.
More information about the busybox
mailing list