rcS shell?
Rob Landley
rob at landley.net
Sun Dec 11 06:16:46 UTC 2005
On Saturday 10 December 2005 13:12, Siddharth Taneja wrote:
> > On Fri, Dec 09, 2005 at 10:52:00PM -0800, Siddharth Taneja wrote:
> >> PLATFORM =`customscript -p`
> >
> > the space after the var name is illegal
> > PLATFORM=`customscript -p`
> >
> >> if [ $PLATFORM = "myplat"] ; then
> >
> > everyone else already pointed out the space you're missing here
> >
> > however, you should also quote $PLATFORM because if it contains spaces,
> > it will trigger errors too
> > if [ "$PLATFORM" = "myplat" ] ; then
> > -mike
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net
> > http://busybox.net/cgi-bin/mailman/listinfo/busybox
>
> Hi All,
>
> Thanks for the reply.
>
> The code that I wrote here was just an example code and I am sure that the
> original code is syntactically correct.
>
> But the problem is that the *same* code which was running fine for years
> through rcS with BB_INIT and BB_LINUXRC options (BB default shell msh)
> does not work when it is put in linuxrc ( BB is not configured with
> BB_INIT and BB_LINUXRC optins and the defalt shell is still msh).
Again, wading through the deep and abiding suckage of init/init.c:
/* See if any special /bin/sh requiring characters are present */
if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
cmd[0] = (char *)DEFAULT_SHELL;
cmd[1] = "-c";
cmd[2] = strcat(strcpy(buf, "exec "), a->command);
cmd[3] = NULL;
And drilling through a few layers of misdirection, we get:
./include/libbb.h:#define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh"
Except we skip the initial "-"...
If your linuxrc hasn't got a /bin/sh...
Rob
--
Steve Ballmer: Innovation! Inigo Montoya: You keep using that word.
I do not think it means what you think it means.
More information about the busybox
mailing list