landley / toybox

toybox
http://landley.net/toybox
BSD Zero Clause License
2.44k stars 340 forks source link

Can you include oksh? #501

Closed ghost closed 6 months ago

ghost commented 6 months ago

The default sh of toybox is too limited. OpenBSD's ksh is very portable and is better compatible with bash.

https://github.com/ibara/oksh

landley commented 6 months ago

The command isn't finished (which is why it's in pending), so we should abandon the unfinished implementation and replace it with an external project? You can already build that project and install it alongside toybox.

It is interesting that oksh is public domain, but toysh has the goal of providing a drop-in bash replacement which that doesn't seem to. I checked out and a copy and "cat oksh/*.c | wc" gives me about ~25k lines, and toysh so far is around 5k lines.

And then there's the "mayfork" commands, which need to exist both standalone and provide shell builtin versions with extra behavior. For example, "which kill" has a version you can call out of the path, but "kill %1" integrates with shell job control. Currently, this is done with the toybox MAYFORK plumbing, which an external project won't have and won't integrate easily with.