Bash shell support?

Riaz Rahaman rahaman.riaz at gmail.com
Tue Aug 29 06:21:20 UTC 2006


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

./rwtest: 395: szcache[0+1]=.: not found
./rwtest: 395: szblks[0+1]=13134: not found

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


On 8/24/06, Riaz Ur Rahaman <rahaman.riaz at gmail.com> wrote:
>
> thanks everybody for helping me out.
>
> At the moment I am restricted to using the ash shell. I did the changes
> as advised of change (( .. )) to [ .. ] and atleast that error went away
> but this another syntax error comes.
>
> rwtest: 319: Syntax error: Bad substitution
>
> I am suspecting that since typeset applet(I hope thatz what it is
> called) is not supported in the ash shell in 1.1.2 version that I am
> using the variable n is being used as a string which is the default type
> but n is to be set to be of type integer by typeset. If typeset wasn't
> supported then why didn't my script give an error at that location?
>
>
> Riaz
>
>
>
> On Wed, 2006-08-23 at 16:59 -0400, Rob Landley wrote:
> > On Wednesday 23 August 2006 6:36 am, Riaz Rahaman wrote:
> > > I am trying to run the ltp test cases on the busybox and there were
> two
> > > scripts that were giving errors. One was the fs_inod and the other
> rwtest.
> >
> > I'm guessing you're using "ash"?  (Alas, we have four built-in shells at
> the
> > moment, and they share very little code...)
> >
> > > I am not looking at the option of patching the busybox to support
> these
> > > utilities as of now, but more of changing this script to run on
> busybox.
> >
> > You don't have to use BusyBox's shells.  If you need bash, you can build
> and
> > install bash on the system.
> >
> > Rob
>
>
>


-- 

Regards,
Riaz Ur Rahaman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060829/2d7b914b/attachment-0002.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rwtest
Type: application/octet-stream
Size: 8809 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060829/2d7b914b/attachment-0002.obj 


More information about the busybox mailing list