[BusyBox] ash variable dereference
Rolland Dudemaine
rolland.dudemaine at msg-software.com
Thu Aug 8 09:40:05 UTC 2002
Wow, thanks !!!
Anyone for the sed question, that would become a Good Day !!!
Best regards,
Rolland Dudemaine
Steve Wahl wrote:
>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.
>_______________________________________________
>busybox mailing list
>busybox at busybox.net
>http://busybox.net/mailman/listinfo/busybox
>
>
>
>
More information about the busybox
mailing list