Bash shell support?

Juergen Hennerich juergen at hennerich.eu
Tue Aug 29 08:00:39 UTC 2006


Riaz Rahaman schrieb:
> I get all these wierd errors now....I ran the same script on the ash 
> shell on my linux box and they work but when I run the same now on 
> busybox it gives error
> 
Your memory does not serve you well. The ash shell in busybox (or any 
other ash shell out there) is not able to run that code, because ash 
lacks support for arrays. And if you haven't found a new ash variant 
with array support it is impossible that this code works with ash.

Another possibility is, that your system not only links /bin/sh to 
/bin/bash, but also has a /bin/ash that is a link to /bin/bash. Although 
that wouldn't make sense to me.

Juergen

> ./rwtest: 395: szcache[0+1]=.: not found
> ./rwtest: 395: szblks[0+1]=13134: not found
> 
^^^^^^^ missing array support.
> for the lines
> 
> szcache[${#szcache[*]}+1]=$dir
> szblks[${#szblks[*]}+1]=$blks
> 
> where $dir is "." and $blks is "13134".
> 
> When I try to echo the value stored  in the array using the below 
> command, it gives a new error
> 
> echo 'szcache[${#szcache[*]}+1]':${szcache[${#szcache[*]}+1]}
> 
> 
> Below is the output log when I run the test case:
> 
> calling rwtest
> Files:10%25000:rw-sync-1593
> calling for loop
> file:rw-sync-1593
> dir:.
> size:10%25000
> setting typeset
> n:0
> n:0
> szcache:0
> n is not less than szcache
> dir:.
> blks:13134
> ./rwtest: 395: szcache[0+1]=.: not found
> ./rwtest: 395: szblks[0+1]=13134: not found
> max: 25000
> size:10
> sz:1313
> max:25000
> sz:1313
> f: 1313b:rw-sync-1593
> ./rwtest: 397: Syntax error: Bad substitution
> 
> In the script he does a df -P, but since -P option is not available in 
> my version of busy box I made that as only df with no options.
> 
> Is there a new scripting language to use for this?
> 
> Shell experts here can you please help me out....I am stuck on this 
> thing for quite long. This is a test script from the LTP package, I 
> think there might be folks here who have used the LTP package on busybox.
> 
> Looking for your reply asap.....
> 
> 
> thank you very much for all the help provided so far.
> 
> Riaz
> 



More information about the busybox mailing list