[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Adding bash support to hush: the todo list.
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-05-22 21:17:05
Message-ID: 201005222317.05776.vda.linux () googlemail ! com
[Download RAW message or body]

On Thursday 20 May 2010 06:24, Michael D. Setzer II wrote:
> On 20 May 2010 at 3:46, Denys Vlasenko wrote:
> 
> From:           	Denys Vlasenko <vda.linux@googlemail.com>
> To:             	busybox@busybox.net
> Subject:        	Re: Adding bash support to hush: the todo list.
> Date sent:      	Thu, 20 May 2010 03:46:24 +0200
> Copies to:      	Rob Landley <rob@landley.net>
> 
> > On Monday 17 May 2010 16:41, Matthew Stoltenberg wrote:
> > > > We probably want some kind of config option for the alias, so bash and busybox
> > > > can easily be installed side by side without interfering with each other.
> > > >
> > > > Rob
> > > 
> > > I'm not the best at wording, but see the attached patch.
> > 
> > I did it a bit differently, akin to CONFIG_FEATURE_SH_IS_FOO options.
> 
> In following the thread on bash support in busybox, I've always included the 
> full bash on my cd project, since I wasn't clear on a way to check that it 
> didn't have any what I guess is bashisms. The script was over 3300 lines 
> long, and I was not the original creator of it. I have recently gone thru it, and 
> reduced it to about 1900 lines by doing a number of things. I just ran 
> checkbashisms on it, found some things it didn't like that were easy to fix.
> Use of function, and had one set of ((  )) that should have just been a ( ).
> 
> There are two other error types that appear many times in the script.
> (unsave echo with backslash) 
> echo "\n"
> 
> Don't know how the one would do this without the backslash?

http://www.opengroup.org/onlinepubs/9699919799/utilities/echo.html

says that \n should be handled specially.
However, on Linux bash and coreutils for many years had a different
kind of echo, one with -neE options, and in this "echo" you need
to use -e to make \n special.

Thus, with "echo" on Linux it is basically impossible to be portable.
Pathetic, isn't it?
You need to resort to using printf utility to get consistent behavior.

> ('$(<foo)' should be '$(cat foo)')
> specialcommand=$(</tmp/mbr)
>
> This one I could change, actually, it was using cat before, but I found 
> something that said this was the better way of doing it.

bashism, yes. One of more ridiculous, not-needed and hard-to-implement ones.
As opposed to, say, $RANDOM bashism, which is easy-to-implement,
useful, and needed (since generating random number without it, portably,
is butt-ugly).

-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic