Hi,
I’m the maintainer of the MirBSD Korn Shell – http://mirbsd.de/mksh –
and have successfully
built a full Android tree with mksh (in two flavours, ① full+printf, ②
small) as an external project
(I’d like to not assign over copyright or equivalent for this, but
still like to get it integrated).
To the developer, it has tab completion, adb can be built withOUT the
evil -DSH_HISTORY
that causes so many problems, and it can be used as a minimal
scripting language as well.
The licence is similar to BSD, DFSG- and FSF-free and OSI and OKFN
approved. Some
auxiliary code (that can be omitted – setmode.c for the optional mknod
(1) builtin, and
printf.c for the optional printf(1) builtin) are under the 3-clause
UCB BSD licence.
If someone thinks this would benefit a replacement of the crappy
NetBSD® ash in its
ancient version, I’d love to hack it into projects/system/core/mksh
and retire sh. On the
bad side, it’s a little larger – on the bright side, it has Korn shell
functions (such as safe
[[ comparision), bash/ksh93/zsh-like extensions, Emacs (and, optional)
Vi editing modes,
and isn’t MUCH larger. It’s also used as /bin/sh by FreeWRT Embedded
GNU/Linux ADK,
so the precedence is set, and it’s very portable and embed-friendly.
-rwxr-xr-x 1 2423 5010 168232 Dec 1 16:56 out/target/product/generic/
system/bin/mksh
-rwxr-xr-x 1 2423 5010 139104 Dec 1 16:57 out/target/product/generic/
system/bin/mksh-small
-rwxr-xr-x 1 2423 5010 86848 Dec 1 15:37 out/target/product/generic/
system/bin/sh
Requirement is the main tree plus Gerrit changes 12676 and 12677.
These have been built from projects/external/mksh. I’ve also
successfully created an
NDK application tree from it, targetting Android 1.5 (with sys_signame
[] provided by
the build instead of Bionic libc).
Now, how do we go on? Is there interest? Should I publish what I
already have?
Where?
By the way, since I couldn’t get the emulator to do so, which encoding
is used by default?
When I print 'm\xe4h' or 'm\ue4h' I get 'mh' both times, seems as if
Terminal were 7bit?
mksh by default looks at setlocale and nl_langinfo(CODESET), which is
not available, so
the options are: look at ${LC_ALL:-${LC_CTYPE:-${LANG:-C}}}, enable
UTF-8 mode by
default, disable UTF-8 mode by default. The last two reduce code size
a little (not much);
I’ve chosen the latter option for now, but, since adb is usually used
from UTF-8 environments,
would enable UTF-8 by default if Terminal is indeed 7bit.
Thanks in advance,
//mirabilos
--
I believe no one can invent an algorithm. One just happens to hit upon
it
when God enlightens him. Or only God invents algorithms, we merely
copy them.
If you don't believe in God, just consider God as Nature if you won't
deny
existence. -- Coywolf Qi Hunt