[BusyBox] help!

guomei2002109 at sohu.com guomei2002109 at sohu.com
Tue Mar 2 01:22:55 UTC 2004


hello! Now I am using busybox 0.60.0(under uclinux ,arm) .I have some questions and I need your help.would you please help me? thanks in advance!

first,I write in the first letter
> BusyBox v0.60.0 (2004.02.26-01:19+0000) Built-in shell (msh)
> > Enter 'help' for a list of built-in commands.
> > 
> > # help
> > 
> > Built-in commands:
> > -------------------
> >         . : break cd continue eval exec exit export help login newgrp
> >         read readonly set shift times trap umask wait [ busybox cat
>           chmod chroot date echo env expr getopt ls msh ps sh sleep test wc
> > 
> your reply:
> This is a very minimalist setup. 
Could you explain it down to the last detail? 

second,Does Busybox v0.60.0 have the function of handling the basic stuff(for, case/esac, while,
if/then/else) ? Because of the uclinux, uclibc, compiled tools that I used, I can't compile the highter version busybox correctly.

Thirdly,The followings are my test script. I put all these files under the /bin directory

a1.txt
#!/bin/sh
# give the initialize value to STR
a="Hello World" 
/tmp/echo $a

b1.txt
#! /bin/sh 
if [ -e /bin/date ]; then 
/tmp/echo `/bin/date` 
else 
/tmp/echo "/bin/date doesnot exist" 
fi 

b2.txt
#! /bin/sh 
if [ -e /bin/date ]; then 
/tmp/echo `/bin/date doesnot exist` 
else 
/tmp/echo "/bin/date " 
fi 

dd3.txt
#!/bin/sh 
/tmp/echo "Hit a key, then hit return." 
read Keypress 
case "$Keypress" in 
 [a-z] ] /tmp/echo "Lowercase letter";; 
 [A-Z] ] /tmp/echo "Uppercase letter";; 
 [0-9] ] /tmp/echo "Digit";; 
 * ] /tmp/echo "Punctuation, whitespace, or other";; 
esac 
exit 0 

f1.txt
#!/bin/sh 
/tmp/echo "input a b" 
read a b 
if [ $a=$b ];then
/tmp/echo 'qual'
else
/tmp/echo 'no equal'
fi
exit 0

ggg.txt
1234

ggg1.txt
#! /bin/sh 
for item in `cat /bin/ggg.txt`;
do
  /tmp/echo $item
done

then I start to test the script under uclinux. and the results are
showed  below.
…………(after the uclinux start up (still using the sash shell))
Sash command shell (version 1.1.1)
/> ln -s /home/busybox /tmp/ls
/> ln -s /home/busybox /tmp/echo
/> ln -s /home/busybox /tmp/sh
/> ln -s /home/busybox /tmp/expr  (note: I put the binary busybox under the /home directory)
/> /tmp/sh

BusyBox v0.60.0 (2004.02.26-01:19+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
# help

Built-in commands:
-------------------
      . : break cd continue eval exec exit export help login newgrp
      read readonly set shift times trap umask wait [ busybox cat
      chmod chroot date echo env expr getopt ls msh ps sh sleep test wc
# /tmp/sh /bin/a1.txt
: not found
Hello World
# /tmp/sh /bin/b1.txt
[: not found
: not found
/bin/date doesnot exist
# /tmp/sh /bin/b2.txt
[: not found
: not found
/bin/date     ( note: whether the date  exits or not,I think b1.txt and b2.txt shouldn't  be the results)
# /tmp/sh /bin/dd3.txt
: not found
Hit a key, then hit return.
s
: not found
syntax error
# /tmp/sh /bin/f1.txt
: not found
input a b
2 2
: not found
syntax error
# /tmp/sh /bin/ggg1.txt
syntax error
#

from the above tests, I think Busybox v0.60.0 don't  handles the basic stuff(for, case/esac, while,
if/then/else) ?
Could you please tell me where I make mistakes? Thank you very much for your kindness!




More information about the busybox mailing list