[haiku-development] Proposal : move away from bash

  • From: pulkomandy <pulkomandy@xxxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 13 Aug 2010 12:16:54 +0200

I'm wondering why we are using bash as a shell interpreter. It's
licenced under the GPL, and we're trying to be an MIT-Licenced system.
Also, it's big and complicated. We apparently have a set of hacks which
prevent us to use the mainstream version and force us to have it in our

I would like to switch to mksh [1]. This one compiles out of the box on
Haiku. The sourcecode is a lot simpler, and it doesn't feature all the
annoying utf-8 bugs that end up making your command line all borked.

The binary is also about 4 times smaller for equivalent functionality.

I did some tests and replaced bash in my Haiku install with mksh. The
bootscript needed one change to the launch function, as mksh doesn't
like "shift" when there is only one argument. I'm not sure this is a bug
in mksh or a real difference between it and bash, as mksh aims for korn
shell compatibility. This would be a move away from BeOS, but bash could
still be provided as an optional package for people really needing it
(and I don't think there is much BeOS software relying on bash being

Finally, this would allow us to close a lot of coverity bugs.

Any good reason not to make the switch ?

[1] https://www.mirbsd.org/mksh.htm


Other related posts: