Bash shell support?
Juergen Hennerich
juergen at hennerich.eu
Tue Aug 29 11:04:32 UTC 2006
Riaz Rahaman schrieb:
> thanks for the info,
>
> The ash in the busybox doesn't support arrays, I am using RHEL3, in that
> I set my shell to to ash and run the same test case which works fine. I
> am trying to find the version of ash by saying ash --version which is
> not supported by ash.
Most likely your tests don't run on ash. How do you start your tests?
Setting your login shell to ash doesn't matter. If you start your script
with sh scrip_name you are using bash. If you start your script with
./script_name and the first line in the script is not "#!/bin/ash", but
"#!/bin/sh" then you are also using bash. You are only using ash if you
start the script with ash script_name or change the first line to
"#!/bin/ash". You can also test for array support if you call start your
ash and type "var[1]=x" for example. If you get an error message, your
ash does not support arrays.
>
> If ash doesn't support arrays, then is there any other way that the
> arrays can be implemented in the script?
>
You can replace arrays with variables like array1_1, array1_2, ... and
make an index variable (like array_index="1 2 3") with the elements that
the array includes. Also the number of elements have to be stored (maybe
in the index variable). The you can make functions to access the array.
> my /bin/sh is mapped to /bin/bash and /bin/ash isn't mapped to /bin/bash
>
> linux at linux:~> ll /bin/sh
> lrwxrwxrwx 1 root root 4 May 30 12:13 /bin/sh -> bash
> linux at linux:~> ll /bin/ash
> -rwxr-xr-x 1 root root 114132 Apr 23 02:09 /bin/ash
>
> I am trying to locate a ash manual which might have this info,I did a
> man ash but that it gave me a shell interpreter manual. If anyone has
> the soft copy of the ash manual, please forward it to me and if the file
> size is large, you can avoid sending to the group, since some folks
> might not like getting large files.
If you have typed "man ash" and got something like:
SH(1) BSD
General Commands Manual
SH(1)
NAME
sh - command interpreter (shell)
then you have the ash manual. Ash is the descendant of the BSD Bourne
compatible shell. There is no other manual.
Juergen
>
>
>
>
>
> On 8/29/06, *Juergen Hennerich* <juergen at hennerich.eu
> <mailto:juergen at hennerich.eu> > wrote:
>
> 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
>
>
>
> --
>
> Regards,
> Riaz Ur Rahaman
More information about the busybox
mailing list