Re: How to do array operation in busybox

2015-06-26 Thread Sven-Göran Bergh
Hi Patrik On 06/26/2015 07:49 AM, Pratik Prajapati wrote: Hi, I am working on LTP-DDT project (https://github.com/rogerq/ltp-ddt) which i cross-compiled for my target and my target uses busybox. But running it on my target gives me error as array operation is not supported in busybox. I have

Re: How to do array operation in busybox

2015-06-26 Thread Pratik Prajapati
I tried one method and was unable to correct it. Can you give me the correct method ? On Fri, Jun 26, 2015 at 11:25 AM, Sven-Göran Bergh sgb-list+busy...@systemaxion.se wrote: Hi Patrik On 06/26/2015 07:49 AM, Pratik Prajapati wrote: Hi, I am working on LTP-DDT project

Re: How to do array operation in busybox

2015-06-26 Thread Sven-Göran Bergh
On 06/26/2015 07:59 AM, Pratik Prajapati wrote: I tried one method and was unable to correct it. Can you give me the correct method ? On Fri, Jun 26, 2015 at 11:25 AM, Sven-Göran Bergh sgb-list+busy...@systemaxion.se mailto:sgb-list+busy...@systemaxion.se wrote: Hi Patrik On

Re: How to do array operation in busybox

2015-06-26 Thread Bastian Bittorf
* Pratik Prajapati pratik.prajapat...@gmail.com [26.06.2015 08:44]: 305: shift 306: index=0307: for arg; 308: do 309: x[$index]=$arg310: ((index++)) 311: done but i got error: syntax error: unexpected ( (expecting }) google for 'POSIX shell array'

Re: How to do array operation in busybox

2015-06-26 Thread walter harms
Am 26.06.2015 11:07, schrieb Pratik Prajapati: Thanks. Your solution is very useful. a more shell like solution is simple using a $IFS separated list and the power of set but if you have sparse values and you need the gaps you are better of with this solution. For the example you could do

Re: How to do array operation in busybox

2015-06-26 Thread Pratik Prajapati
Thanks. Your solution is very useful. On Fri, Jun 26, 2015 at 12:01 PM, Sven-Göran Bergh sgb-list+busy...@systemaxion.se wrote: On 06/26/2015 07:59 AM, Pratik Prajapati wrote: I tried one method and was unable to correct it. Can you give me the correct method ? On Fri, Jun 26, 2015 at

Re: How to do array operation in busybox

2015-06-26 Thread Pratik Prajapati
Thanks On Fri, Jun 26, 2015 at 5:08 PM, walter harms wha...@bfs.de wrote: Am 26.06.2015 13:15, schrieb Pratik Prajapati: I tried your solution but couldn't print that array: for index in 1 2 3 ; do eval echo \$LST$index done yes, because it builds a string and it has no

Re: How to do array operation in busybox

2015-06-26 Thread walter harms
Am 26.06.2015 13:15, schrieb Pratik Prajapati: I tried your solution but couldn't print that array: for index in 1 2 3 ; do eval echo \$LST$index done yes, because it builds a string and it has no need for eval LST= for index in 1 2 3 do LST=$LST $index done echo LST=

How to do array operation in busybox

2015-06-25 Thread Pratik Prajapati
Hi, I am working on LTP-DDT project (https://github.com/rogerq/ltp-ddt) which i cross-compiled for my target and my target uses busybox. But running it on my target gives me error as array operation is not supported in busybox. I have attached script with this mail. I am getting error for :