Backslashed escape sequences

Roy Marples roy at marples.name
Mon Sep 22 16:20:02 UTC 2008


On Mon, 2008-09-22 at 10:30 -0500, Rob Landley wrote:
> > No, busybox has adopted a few shells, of which ash is probably the most
> > POSIX compliant one. busybox has never adopted bash.
> 
> Bash as a codebase to use, no.  Bash as a de-facto Linux standard against 
> which to compare its shell behavior, yes.  (CONFIG_ASH_BASH_COMPAT anyone?)

Pretty sure that's broken. Or at least it was when I last looked at it.

> > > Now these were mostly old versions of bash.  I stopped paying attention
> > > to anything that went in after 2.04b.  But things like curly bracket file
> > > listing syntax, or echo needing -e?  You encounter them all over the
> > > place in Linux.
> > >
> > > (And note that if you use dash, echo doesn't support options at all.
> > > No "echo -e" or "echo -n".  Yeah, that breaks things.)
> >
> > Such scripts should use #!/bin/bash instead of #!/bin/sh.
> 
> No scripts should use #!/bin/sh anymore, Ubuntu broke that symlink with the 
> Defective Annoying SHell.  Which means that at some point, Busybox is going 
> to have to provide a #!/bin/bash symlink if it wants to be able to run things 
> like the linux kernel's scripts/gen_initramfs_list.sh.

No, you provide bash or recode the script for POSIX sh.
To give a trivial example, I've attached a patch for
gen_initramfs_list.sh (untested) that should allow it to work for
busybox ash.

By your argument, you could have #!/usr/bin/perl and expect it to run
your python script.

> In the meantime, the minimal self-bootstrapping environment is still seven 
> packages, one of which is bash.

So is GCC or are you imlying that busybox should have that also?

> 
> > If you want bash features then explicitly use bash. If you want bash
> > features in /bin/sh then get the The Open Group to adopt them :)
> 
> If you want to use Solaris, you know where it is.

Eh? Solaris has nothing todo with this discussion.

>
> > > I have several scripts that use \e as the start of ansi escape sequences,
> > > by the way.  (Octal's a bit 1970's for my tastes...)
> >
> > Again, suggest your idea to the The Open Group or just use bash.
> 
> Please delete the "mount" command off your system, since it's not in The Open 
> Group Base Specifications, so obviously you can't possibly need it.

mount command is system specific.
The Open Group Base Specifications are just that - where specified it's
an agreed way of working. sh is an agreed way of working, so if sh is
used it can expect to behave in the specified maner from system to
system.

> 
> > I like the ability to use /bin/sh so my scripts work on default base
> > systems such as NetBSD where bash not available by default.
> 
> You've used busybox on netbsd?  (Without a Linux compatability layer?)  This 
> is new...

No, I've not used busybox on NetBSD, nor have I ever made such a claim.
However, my scripts (of which I have many) work with the system
provided /bin/sh which includes (but is not limited to) NetBSD, FreeBSD,
OpenBSD. They also work on the myriad of other shells - bash, dash,
busybox (ash), zsh. I've not tried others personally, but people report
success.

These are not trivial scripts - they boot the OS
(http://roy.marples.name/openrc)

Thanks

Roy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gen_initramfs_list.sh.diff
Type: text/x-patch
Size: 1693 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080922/5c8ad987/attachment-0002.bin 


More information about the busybox mailing list