mksh(1) R35b
This is the website of the MirBSD™ Korn Shell, an actively developed free implementation of the Korn Shell programming language and a successor to the Public Domain Korn Shell (pdksh).
This page is always accessible via a redirection at http://mirbsd.de/mksh, which is the canonical homepage URI, and in case the webserver is unreachable, the backup page will provide basic information. The FSF/UNESCO directory of Free Software lists mksh, too.
Table of Contents
- Introduction and Licence
- Support (IRC, manual page, mailing lists, …)
- Installation
- Upgrade your packages from older mksh
- Inclusion in operating systems
- comparision with other shells
- Testsuite Results
- on version numbers – for packagers
- future plans
- ChangeLog
- information about old versions
Introduction
The current version of mksh is mksh R35b from 18 July 2008.
Thanks to “Der Verein trash.net” for sponsoring access to a Solaris 8 box. Thanks to HP TestDrive, which helps in keeping mksh portable to several Unixes and compilers, and track down some architecture- or glibc-specific bugs. Thanks to Julian “yofuh” Wiesener for just another account on a Sun E420 on Solaris 11β. Thanks to someone who prefers to stay anonymous due to tons of red tape for providing access to an AIX 5.3 system with gcc and xlC installed. Thanks to gnubber’s admin (Barry “bddebian” deFreese), as well as Samuel “youpi” Thibault, for providing shell access to a Debian GNU/HURD system. Thanks to Lucas “laffer1” Holt for ssh access to the MidnightBSD server. Thanks to Waldemar “wbx” Brodkorb for dropping his unused Zaurus SL-C3200 to someone who can actually make use of it to test mksh on OpenBSD. Thanks to Andreas “gecko2” Gockel for access to a couple of Debian and Macintosh boxen. Thanks to Martin Zobel-Helas for an account on an Alpha system. Thanks to Bastian “waldi” Blank for access to an S/390 system and uploading mksh packages to Debian for quite some time. Also thanks to Otavio Salvador for uploading a couple of my Debian packages. The Debian GNU/k*BSD and HURD developers were quite helpful in assisting and testing as well. Thanks to Thomas E. “TGEN” Spanjaard for access to both a NetBSD and a DragonFly system. Thanks to Josef “jupp” / “penpen” Schugt for testing mksh on a Digital Unix (OSF/1 V4.0) system from the Uni Bonn Physik CIP Pool. Thanks to DEChengst from #UnixNL for providing access to a HP/Compaq Tru64 (OSF/1 V5.1B) system, an OSF/1 V2.0 system and an Ultrix 4.5 system. Thanks to Adam “replaced” Hoka for a BSDi BSD/OS 3.1 ISO9660 image. (Did I miss anyone? Mail me if so.)
What is mksh(1)? – Short answer: The MirBSD Korn Shell. Okay, but what exactly does it do, or why another shell? These questions will be answered below for the people interested. Right now, you only need to know that mksh is a DFSG-free and OSD-compliant successor to pdksh, developed as part of the MirOS Project as native bourne/POSIX/korn shell for MirOS BSD, but also to be readily available under other UNIX®-like operating systems.
The source code for mksh is available at the MirOS Project mirrors as well as these of other operating system projects due to being included in these; however, we do not provide binaries. Find instructions to build and install mksh below, or ask your operating environment vendor to package and include mksh; we provide assistance for this task if asked. Licencing permits this as long as due credit is given to the authors and contributors and the copyright notices are not removed in their entirety; modifying is allowed (but if the result is still called mksh, it’s discouraged; talk with us if you feel you have to modify mksh). The individual licences used are the MirOS licence, 2-clause and 3-clause UCB licences and the ISC licence; full terms are available via CVSweb. pdksh originally was public domain, with a few exceptions, but these files are not part of mksh R21 or up. The mksh(1) author (mirabilos) acknowledges the contributions of these people who dedicated pdksh to the public, and asserts a collective copyright on the code. All these licences are DFSG clean and conform to the OSD, and the MirOS Licence is listed on the pages of the ifrOSS licence centre as well as in the FSF/UNESCO Directory of Free Software.
To compile mksh, you will need a bourne or POSIX shell (Solaris
/bin/sh is enough, and the Z shell should work), a C compiler (at
the moment, only the one from the GNU Compiler
Collection works, but we’re attempting to change this), system and C
library header files and the standard C runtime. You will also need a set of
standard UNIX® tools on a supported operating system: any recent BSD; Darwin,
Apple Mac OSX; Interix (Microsoft® Services for Unix 3.5, maybe Subsystem for
Unix Applications); GNU/Cygwin; UWIN; GNU/Linux (libc5, glibc, and uClibc
systems are tested), Debian GNU/kFreeBSD, GNU/HURD or GNU/Linux; Sun Solaris
(8, 9, 10, 11), OpenSolaris; AIX; HP-UX 11i; OSF/1; ULTRIX
To run the
regression test suite, you will need a not too antiquated Perl with POSIX.pm
as well as /bin/ed (whose installation is
strongly suggested anyway, because it’s the standard FCEDIT history
editor and standard UNIX® text editor), as well as a controlling terminal,
usually /dev/tty or provided from script(1) or GNU screen.
To use mksh, you only need the C runtime (and any supplemental libraries the binary was linked against) and, optionally, /bin/ed – for interactive use, a controlling terminal is highly recommended because job control does not work without one.
To make full use of mksh(1)’s interactive features, it is recommended to copy the dot.mkshrc file from the source distribution as ~/.mkshrc into the user’s home directory and let the user adjust it to suit his needs. The sample file configures a few aliases and shell functions as well as a sensible prompt ($PS1) and some csh-like directory stack functions and zsh-like hooks. Full use of this file requires a few special UNIX® tools, e.g. readlink(1) with the -f flag.
Support
We provide an online manual page in HTML and PDF format. Reading books about Korn Shells in general is recommended as further help, but beware of the differences to other shells. Some ISBNs are listed at the end of the manual page.
If you require additional assistance or want to discuss bugs, features or enhancements, write to the mailing list (or subscribe to it). The mailing list can be reached via NNTP or at the MARC web archive (or GMane Loom) as well. Joining the IRC channel at Freenode (irc.freenode.net:6667) #!/bin/mksh (no joke, this is really the channel’s name) and #ksh (where you must distinguish AT&T ksh from mksh though) is recommended as well.
Installation
Skip to the section about being included in operating environments unless you really want to compile mksh from source yourself or create a package for your operating system of choice.
First off, you have to download the source code from any of the mirrors listed below, or any other mirror you know of. Official source code distributions are a cpio(1) compressed “old-style” (portable octal) archive, compressed with gzip(1) (zlib’s deflate algorithm) and digitally signed with gzsig(1) using the MirOS Project’s current signature key. Please verify the signature as well as the hashes and/or checksums below, so you’re sure the content is intact and the version number on the archive is correct. If you require source code in tar(1)’s “ustar” format, check the Debian Project for availability, although they often do not carry the latest version. The pax(1) utility (the POSIX Archiver) can extract from the CPIO distfile and is available even on a stock Microsoft® Windows® installation.
Known Mirrors
- http://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R35b.cpio.gz
- http://pub.allbsd.org/MirOS/dist/mir/mksh/mksh-R35b.cpio.gz
Checksums and Hashes
- RMD160 (mksh-R35b.cpio.gz) = 882cbe0d2c46b8f024288b0f594a4b219e8fbd51
- TIGER (mksh-R35b.cpio.gz) = 753b2a63fce9f226a1ab989c3ecb933046d502b9464c77d0
- 4126823992 263452 /MirOS/dist/mir/mksh/mksh-R35b.cpio.gz
- MD5 (mksh-R35b.cpio.gz) = 0e96cd3f8141b7abc679bbb303a8be2c
- All official distfiles are gzsig(1)d.
Decompression
Use any of the following syntaxes to extract the distfile; you’ll get the idea soon. Some web browsers (prominently, Mozilla® and its derivates as well as Microsoft® Internet Explorer®) already inflate the distfile during download but do not remove the “.gz” extension; replace “gzip -dc” (gzcat) with “cat” if that happens for you.
The first example is using BSD paxtar (MirOS BSD, OpenBSD, NetBSD®), or “bsdtar” (DragonFly); the second and third use cpio(1) or pax(1) and are for most operating systems; the fourth is for Debian.
- $ tar xzf mksh-R35b.cpio.gz && cd mksh
- $ gzip -dc mksh-R35b.cpio.gz | cpio -mid && cd mksh
- $ gzip -dc mksh-R35b.cpio.gz | pax -r && cd mksh
- and, in exceptional cases
- $ tar xzf mksh_35.2.orig.tar.gz && cd mksh-35.2
Compilation
Now you’re in the source code directory; Build.sh does all the
magic for you. In theory, invoking the command
% /bin/sh ./Build.sh
should work. Relative paths can be used too, for example, instead of cd(1)ing
to the source directory, you could’ve done
% mkdir build; cd build; /bin/sh ../mksh/Build.sh
The build script requires a bourne shell (Solaris /bin/sh or the Heirloom sh, korn shell (ksh, ksh88, ksh93, pdksh, mksh, oksh, maybe the MKS ksh), POSIX shell (posh, /usr/xpg4/bin/sh, ash, dash), or a super-set (GNU bash) to work; the Z Shell could work too, but the C shell (csh, tcsh) or “bsh” or a scripting shell like the wish won’t. Accepted arguments are:
- -j – parallel build (mksh R31d and up)
- -q – output almost nothing
- -Q – be (only) a little less verbose
- -r – don’t try to build a pre-formatted version of the manual page using nroff(1) if found – recommended
The build script also honours the following environment variables:
- CC (gcc) – the C compiler used
- CFLAGS (-O2 / -xO2; on HP-UX/IA64: -O2 -mlp64) – optimiser and other compiler flags used
- CPPFLAGS (no default) – additional cpp(1) flags
- LDFLAGS (set on AIX for libcrypt) – additional CCLD flags
- LIBS (-lcrypt on Interix; empty otherwise) – additional libraries to pull in
- NOWARN (-Wno-error / -errwarn=%none) – $CC option to disable bailing out at errors; used during mirtoconf checks
- NROFF (nroff; “nroff -c” with GNU groff) – the manual page processor used unless -r is given
- TARGET_OS (uname -s || uname) – the operating system to compile for; set this during cross compilation; valid: AIX CYGWIN* Darwin DragonFly FreeBSD GNU (HURD) GNU/kFreeBSD HP-UX Interix Linux Minix (not yet) MirBSD NetBSD OpenBSD Plan9 (not yet) SunOS UWIN
If CPPFLAGS contain any of the following definitions, the resulting binary will be compiled with a specific flavour:
- -DMKSH_SMALL – build a really small mksh(1), e.g. for embedded systems
- -DMKSH_ASSUME_UTF8 – do not use setlocale(3) or nl_langinfo(CODESET); assume the terminal is always in UTF-8 mode
- -DMKSH_NOPWNAM – if MKSH_SMALL is not set, still omit getpwnam(3) calls in order to not pull in the nsswitch or PAM libraries
- -DMKSH_NOVI – if this or MKSH_SMALL is set, the vi command line editing mode is omitted
You can override certain mirtoconf checks by setting environment variables
like HAVE_REVOKE=0 (default for Linux) – if these are set to 0 or 1,
the values are used; if unset, the values are probed (unless overridden by a
different check, such as MKSH_SMALL), if set to ‘x’ the probe is forced.
Useful items to enable/disable are HAVE_MKNOD and HAVE_READLINE (set to 0 to
disable, set to x to re-enable for MKSH_SMALL), HAVE_SETLOCALE_CTYPE (set to
0 if you know that it won’t ever return UTF-8), HAVE_PERSISTENT_HISTORY (0 to
not include this feature).
Operating Environment specific notes
Compiler: ACK
Support for ACK on Minix 3 will be added after mksh works on Minix 3 with GCC. Support for other ACK versions or targets can be user-contributed.
Compiler: Borland C++ Builder
This compiler is somewhat supported in mksh R30 with UWIN’s cc wrapper. (We haven’t been able to produce a working executable though.)
Compiler: DEC/Compaq/HP C for OSF/1 and Tru64
This compiler is fully supported with mksh R33b (partial support did appear earlier).
Compiler: Digital Mars
This compiler is somewhat supported in mksh R30 with UWIN’s cc wrapper and a few kludges. (We haven’t been able to produce a tested executable though, due to general stability issues with the UWIN platform.)
Compiler: GCC
The GNU C Compiler 1.42, 2.7.2.1, 2.7.2.3, egcs (gcc 2.95) and the GNU Compiler Collection (gcc 3.x, 4.x) are known to work, but not all versions work on all targets. Specific C flags, known extensions, etc. are autoprobed; cross-compilation works fine. Use of gcc 4.x is discouraged because of several dangerous changes in how the optimiser works; it is possible to work around their trading off reliability for benchmark-only speed increases, but because mksh developers do not use gcc 4.x this will have to be user-contributed. On the other hand, gcc 3.x (in some cases 2.x) is the best choice for compiling mksh.
On BSDi BSD/OS, where gcc 1.42 and gcc 2.7.2.1 are available, the cc(1) manual page mentions that gcc 1.42 produces more reliable code, so we recommend to build mksh with CC=cc (gcc1) instead of CC=gcc or CC=gcc2 there instead.
Since mksh uses ProPolice, the Stack-Smashing Protector, some GCC versions’ compilates require additional shared libaraies.
Compiler: HP C/aC++
HP’s C compiler (/usr/bin/cc on HP-UX) is supported in mksh R30 and above; on IA64, only the LP64 model can be used; mksh segfaults in the ILP32 module (or rather, the system libraries do, I think), so it is default. PA-RISC too works fine, so this compiler is a primary choice.
Compiler: IBM XL C/C++ / VisualAge
IBM xlC 9.0 on AIX is supported in mksh R30 and above.
IBM xlC 8.0 on Linux/POWER and IBM xlC 6.0β on MacOS X are on the TODO.
Compiler: Intel C/C++/Fortran
ICC emulates GCC quite well (too well for my taste), is fully supported in mksh R30 and above on several platforms, but spits out lots (and I mean huge ugly lots) of bogus warnings during compile. We’re not going to work around these; let Intel fix their compiler instead. Some of these warnings were even responsible for bugs in mksh.
I could not get the Intel Compiler 10 for Windows® to work.
mksh enables the ICC stack protector option automaticaly. Compilates usually require the Intel shared libraries to be around.
Compiler: LLVM
Apple llvm-gcc from Xcode 3.1 had full success with mksh R34.
Vanilla llvm-gcc works fine as well.
Vanilla llvm-clang produces output which fails 83% of the test suite.
Compiler: Microsoft® C/C++
Support for the Microsoft® C Compiler on Interix and UWIN, with the respective /usr/bin/cc wrappers, appeared in mksh R30. The following product versions have been tested:
CL.EXE: Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.00.9466 for 80x86
LINK.EXE: Microsoft (R) Incremental Linker Version 7.00.9466
(both are part of the .NET Common Language Runtime redistributable)
CL.EXE: Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
LINK.EXE: Microsoft (R) Incremental Linker Version 8.00.50727.42
(both are part of Visual Studio 2005 C++ Expreß)
You’ll have to change Interix’ cc(1) wrapper though: replace /Op
with /Gs- to disable the stack checks (missing support in libc
for them, they used to be off by default) and remove /Ze.
On Interix (SFU 3.5), this compiler is maturely usable and a good choice.
On GNU/Cygwin, using wgcc it might be possible to use this compiler. I could not test that yet, though.
On UWIN, this is usable as well.
Compiler: MIPSpro
Support for SGI’s MIPSpro compiler on IRIX appeared in mksh R33b.
Compiler: PCC (BSD)
Support for the Caldera/SCO UNIX® based, BSD-licenced portable C compiler in the ragge version has been added with mksh R31d. Versions from end of April 2008 onwards are known to work reliably, even with -O enabled.
The compiler itself rarely works on GNU/Linux or Darwin due to GNUisms, assembler problems, etc. though.
Compiler: SUNpro
Support for the SUN Studio 12 compiler (cc 5.9) as well as cc 5.8 appeared in mksh R30; other versions might be supported as well. This compiler is a primary choice.
Compiler: tcc (Tiny C)
Support for Fabrice Bellard’s tcc appeared in mksh R31, although its unability to do ‘-E’ in older versions gave us some headache, and glibc currently makes it impossible to link the final executable.
Compiler: TenDRA (maybe Ten15 too)
Support for TenDRA appeared in mksh R31 and appears to be solid; mksh uses the ‘system’ profile for compiling by default. Users who wish to build mksh with a different profile are welcome to help to port it.
See ULTRIX for an example of getting a ‘POSIX’ profile to work.
Compiler: DEC ucode (MIPS CC)
Since mksh R33c, ucode on Ultrix is fully supported. OSF/1 2.0’s ucode version cannot be supported as of now, as we don’t know how to determine linkage failures: the compiler returns errorlevel zero, an a.out file is generated and has executable permissions.
Toolchain: dietlibc
Fefe’s dietlibc works in mksh R34, although his opinion towards certain standards, such as caddr_t, strcasecmp(3), etc. are weird.
OS: AIX
Support for AIX with xlC appeared in mksh R30.
If passing custom LDFLAGS, don’t forget the export symbols required for using libcrypt. If passing custom LIBS, don’t forget -lcrypt.
OS: BSDi BSD/OS
BSD/OS 3.1 works fine with mksh R33.
OS: GNU/Cygwin
This operating environment is supported as much as it adheres to standard POSIX/SUSv3 conformant things. No workarounds for .exe suffixes or other platform-specific quirks have been or will be added.
OS: Darwin / Mac OSX
Works pretty well.
OS: DragonFly BSD
Perfect choice.
OS: FreeBSD
Perfect choice.
OS: GNU/HURD
This operating system is supported (on i386) since R29 but not well tested. mksh is part of Debian GNU/HURD, so it is expected to work.
OS: GNU/k*BSD
This operating environment has been supported for quite a while as part of Debian and somewhat tested.
OS: GNU/Linux
While POSIX does not apply to “GNU’s Not Unix”, the FHS (ex-FSSTND) does; please convince your distributor to move ed to /bin/ed if not already done. Manual page installation paths are not standardised in older distributions either.
Besides glibc (GNU libc), dietlibc (from Fefe), µClibc (embedded), and libc5 (on Linux 2.0.38) work, but locale detection is not automatic.
mksh can be used as /bin/sh on Debian and similarly strict distributions, which allow to use e.g. ash/dash there as well.
OS: HP-UX
Support for HP-UX with GCC appeared in mksh R29 and works with HP’s C compiler and is no longer experimental in mksh R30. Please use stty(1) to make the terminal sanely usable.
If passing custom CFLAGS, don’t forget -mlp64 (GCC) or +DD64 on Itanium.
OS: Interix
We have only tested SFU 3.5 on Windows® 2000, not SUA on Windows® 2003 SR1 or the version integrated into Vista.
As the Unix Perl which comes with Interix is too old, and the ActiveState Perl has… other issues, to run the regression tests, please install Perl from NetBSD® pkgsrc® instead.
As of mksh R30, the native compiler (cc(1)) is supported in addition to gcc, calling Microsoft C. Do not use the c89(1) wrapper.
If passing custom LIBS, don’t forget to add -lcrypt or any other library providing arc4random(3).
mksh can replace /bin/ksh and /bin/sh without any problems.
OS: IRIX
Support for IRIX64 6.5 appeared in mksh R33b.
OS: MidnightBSD
mksh is part of MidnightBSD 0.3 and above and used as native /bin/ksh; it almost certainly can be used as /bin/sh as well.
OS: Minix
Minix 3 is not supported yet – we were able to create an executable, but it did not run properly due to job control issues, similar to Plan 9. Minix 1 and Minix 2 will never be supported due to size constraints on 16-bit platforms, unless a user contributes code.
OS: MirBSD
Perfect choice. This is where mksh comes from.
OS: NetBSD
Perfect choice.
Starting with NetBSD 1.6, mksh can replace /bin/ksh and /bin/sh without any problems. On NetBSD 1.5, mksh can only replace /bin/ksh safely.
OS: OpenBSD
The setlocale(3) call in OpenBSD’s libc will always return the “C” locale and therefore has been disabled by default.
mksh can replace /bin/ksh and /bin/sh without any problems.
OS: DEC/Compaq OSF/1, Compaq/HP Tru64
Digital Unix is somewhat supported using gcc as of mksh R31b. With mksh R33b, many more versions and the native compiler work.
OS: Plan 9
Plan 9 is not supported yet – we were able to create an executable, but it did not return to the prompt after running a non-builtin command; this is job control issues, and patches are welcome.
Due to the unavailability of ttys, job control will never be supported.
The APE (ANSI’n’POSIX Environment) is required to build mksh; I don’t remember which compiler I used, but I think it was GCC.
OS: PW32 on Win2k
PW32 is not supported yet – killpg() and getrlimit() are missing, and it’s possible that PW32 and Minix 3, at least, need job control disabled or worked around. Maybe peek at how ash/bash for PW32 do it. gcc works.
OS: Solaris
Solaris is full supported since “forever” with gcc, and since mksh R30 with Sun’s C compiler. Both 32-bit and 64-bit modes work; 64-bit mode is not enabled by default by Build.sh, you must do that manually by passing CFLAGS of -O2 -m64 or -xO2 -xarch=generic64.
Solaris does not come with Berkeley mdoc macros for nroff, so using the HTML or PDF versions of the manual pages or pregenerating a catman page on another OS is required.
OS: Syllable Desktop
This does not yet work due to a signal passing bug in the AtheOS kernel, we were told by their developers. However, mksh R33 is at the same level of support as Plan 9 now.
Syllable Server will work, as it is, at the moment, “just” a GNU/Linux distribution with a different GUI. This may change though.
OS: ULTRIX
Even on ULTRIX 4.5, mksh R33c works fine. The system ksh must be used for running the Build.sh script, though.
You however must pass the -YPOSIX option to the ucode compiler, as the default -YBSD profile produces a broken executable (spins instead of starting up), and the -YSYSTEM_FIVE profile does not even compile. See TenDRA for another OE which has issues with different OE profiles.
OS: UWIN-NT
Compilation of mksh R30 on UWIN works with several compilers (bcc, dmc, msc – I could not get gcc-egcs, gcc-2.95, gcc-mingw, icc to work) but the platform itself is very flakey, and even some regression tests crash, due to target limitations apparently. Within these limits, mksh is usable.
After compiling
The Build.sh script generates an executable (“mksh”, except on
GNU/Cygwin, where it is called “mksh.exe”), a shell script to use the newly
built mksh to run the regression test suite (“test.sh”), and (unless the
-r option was given) a pre-formatted manual page (“mksh.cat1”).
It also lists installation instructions unless -q or -Q
were provided. Now it’s the time to run
% ./test.sh -v
in order to see if the shell works.
To actually install mksh, copy the binary to some place in $PATH, i.e. /bin/mksh, $HOME/.bin/mksh, /usr/local/bin/mksh, or whatever your packaging system wants; strip it and run chmod 555 on it. (This can easily be achieved with install(1) – on Solaris, this is /usr/ucb/install not /usr/bin/install – with the arguments -c, -s, -m 755¹, and -o/-g. ① with 555, strip(1) cannot write the file any more, chmod 555 afterwards.) Also append its installation path to /etc/shells, install the dot.mkshrc file (usually alongside with the copyright file and other documentation), copy it to /etc/skel/.mkshrc if your operating environment has this means to include default dotfiles; install either the catman page (mksh.cat1) to, for example, /usr/share/man/cat1/mksh.0, or the mdoc page (mksh.1) to the standard location (/usr/share/man/man1/ or /usr/man/man1/ or whatever your operating environment requires). The manual page requires the Berkeley mdoc macros (either the BSD or the GNU groff version) to be installed during formatting time.
For packagers: Upgrades
At Freshmeat you can subscribe to get automatically notified (with a summary of changes, not the complete changelog, see below) whenever new releases are put out.
Note: This is not the ChangeLog, these are the packager-visible upgrade notes regarding changes in the build system (Build.sh and friends, compiler support, packaging conventions, bad examples, etc).
mksh R35b builds on some more platforms and throws less warnings, but the build system is almost unchanged; test.sh now shows the Perl binary used (honours $PERL) and its version.
In mksh R35, setlocale/nl_langinfo have been disabled by default for
some platforms. If we do not assume UTF-8, disabling lets mksh employ
the LANG and LC_* environment variables for codeset
determination. Also, a new builtin is included depending on existence
of the readlink(3) function, disabled by default if MKSH_SMALL. The
“pdksh” check category is no longer persistent. The licence has changed
(the advertising clause was removed). The dot.mkshrc sample
was changed to improve re-use.
There was no R34.
No changes in mksh R33c except for Ultrix support. None in R33d.
In mksh R33b, much more compilers are detected, even if not all of them are supported. The OE (OS and CC/LD) versions are now dumped too. Instead of #error, forced link failures are now used as the mechanism to auto-detect some things in the target environment. Features are now much better detected, and some annoying warnings don’t show up any longer due to this. Less tools are required to build.
Please be reminded that you should run ./test.sh -v inside an environment with /dev/tty available (as device node) and usable (e.g. use script(1) or GNU screen if you’re doing auto-builds detached from controlling terminal). Use -v to see failures.
No surprises in mksh R33 either, but the build system now gives more detailed output on the version actually built, to aid tracking down FTBFSen (build errors) with access to only the build logs. Regression tests now work with Intel’s compiler on SLES too, which requires a custom LD_LIBRARY_PATH formerly stripped by the script.
No surprises in mksh R32, but some ancient systems (AIX, Solaris 11, OSF/1, UWIN) are now better supported.
In mksh R31d, parallel make with ‘-j’ was added (no limitation on number of childs though), this even works with Solaris 8 /bin/sh. The MKSH_NEED_MKNOD define is no longer honoured.
From mksh R31 to R31b, arc4random.c has been upgraded.
From mksh R30 to R31, there are no surprises. The “arc4random.c” file is available from mircvs://contrib/code/Snippets/arc4random.c now, and the new “source” command is not available in posix mode either.
From mksh R29 to R30, the following things should be kept in mind:
The syntax of Build.sh has changed: $CC now defaults to “cc” instead of “gcc”, and the ‘-d’ and ‘-nd’ arguments are gone – if you want to build a statically linked mksh, pass LDSTATIC=-static (gcc+GNU ld, adjust for other OEs) to it. An “arc4random.c” is now automatically included into the build if found in the source directory. The $CPP variable is ignored, $CC -E is used instead, except for tcc, which uses “cpp -D__TINYC__” because “tcc -E” doesn’t work.
As a tribute to better POSIX compatibility, certain aliases (like “stop”) are no longer predefined in “set -o posix” mode, which is invoked automatically if the shell is run as -sh, /bin/sh or similar, so that they can be used as function names.
If defining MKSH_SMALL, the ‘vi’ editing mode is omitted, which may surprise your users.
Many compilers other than gcc are now supported as well as AIX.
Inclusion in other operating systems
- Crux GNU/Linux has an mksh port contributed by Han Boetes.
- Debian GNU/Linux, GNU/HURD and GNU/kFreeBSD have an mksh package maintained by the MirOS Project and uploaded (sponsored) by Bastian “waldi” Blank and Otavio Salvador; the debconf questions were taken from dash. The mksh Debian source package is available, too.
- Gentoo GNU/Linux has an mksh ebuild created by Hanno Böck.
- Fedora GNU/Linux 8 and Fedora GNU/Linux 7, as well as RHEL 4 and 5 (via EPEL) now officially contain an mksh package. There are some Instructions for activating EPEL (RHEL only), then just type yum install mksh.
- The OpenSuSE Build Service provides an mksh package inside the shells repo, thanks to Pascal “loki” Bleser and Marcus “darix” Rückert; the RPMs are available for various instances of SuSE, OpenSuSE and Redhat/Fedora Core as well as as SRPM (source RPM). There used to be a repository by loki in the past.
- An inofficial portable SRPM (created on Debian GNU/kFreeBSD) is available as well. This one contains the arc4random.c support routines for operating systems from clueless vendors (GNU, Sun, etc).
- Fink delivers an mksh package from Andreas “gecko2” Gockel.
- SMGL (Sourcemage GNU/Linux) has an mksh spell in their grimoire, developed by the MirOS Project together with Daniel “morfic” Goller, updated by Thomas “sobukus” Orgis.
- In the FreeWRT Embedded GNU/Linux Appliance Development Kit (meta distribution), the mksh package is maintained by us. mksh is also the default shell in FreeWRT trunk (soon to be 1.1) and above.
- OpenWrt Embedded GNU/Linux Distribution also provides mksh on ADSL/WLAN routers thanks to Felix “nbd” Fietkau.
- Ubuntu GNU/Linux, Nexenta OS (GNU/Solaris), the grml (and grml64) Live-CD, and other Debian derivates also have an mksh package; Knoppix, SIDUX, and grml-small do not contain or offer mksh. Note: We need URLs to the packages for these, can anyone provide any?
- Arch GNU/Linux users can install an mksh package by Daniel “homsn” Hommel.
- FreeBSD® Ports (for FreeBSD, very old DragonFly BSD versions and DesktopBSD) also have a port created by Andreas “ankon” Kohn and kept up to date by Martin “miwi” Wilke. It is unknown if this applies to PC-BSD too, but there’s no mksh PBI (yet?).
- MidnightBSD uses mports, a derivate of FreeBSD® ports. Naturally, they deliver mksh as well. MidnightBSD 0.2-CURRENT from 18th August 2007 onwards has mksh as both /bin/mksh and /bin/ksh, i.e. it is the default Korn shell.
- NetBSD® pkgsrc® (native also on recent DragonFly BSD; available for many other operating systems as well) has a package created by the MirOS Project and kept up to date by Blair Sadewitz, a fan. And this source package is provided by the MirOS project in case it’s more recent.
- The MirPorts Framework brings mksh to OpenBSD, Mac OSX and Interix as well as older MirOS BSD versions, which have mksh as native Korn Shell.
- OpenBSD ports do not package mksh, but an inofficial port is available.
- ChinaLinux mirrors (and apparently packages) mksh.
- Some US-American Apple Users’ Group (the HMUG) packages mksh for Darwin, too.
- Frugalware Linux contains a broken mksh package; the build logs show the problem is on their side. (XXX Someone has any URL for us?)
- There are probably many more, please drop us a note!
- Softpedia lists mksh, just like the FSF/UNESCO directory.
These packages are not official and have not always been tested by mksh developers; please keep this in mind.
Other Shells and more
mksh is a successor of pdksh but not affiliated with the pdksh developers or contributors. mksh is not affiliated with the AT&T Korn Shell, its past or present owners, other than that both attempt to implement the Korn Shell programming language.
mksh targets users who desire a compact, fast, reliable, secure shell not cut off modern extensions; a shell with Unicode support; an actively developed, current, and portable product; one with developers that listen to their users’ requests and implement them if they actually make sense.
mksh aims to replace pdksh in all but very rare use cases (such as support for checking the Unix mbox) and in all operating environments (thus including patches from pdksh on e.g. Debian).
Differences
mksh is a direct descendant from the OpenBSD /bin/ksh and contains all of its bug fixes and enhancements except the “GNU bash-like $PS1” and “ulimit can handle multiple limits in one invocation” changes. The DeliLinux developer who is responsible for packaging oksh for GNU/Linux should instead use mksh and port that diff over (be careful to not break the fixes to the command line editing modes, these are subtilely broken in OpenBSD). Even better, the OpenBSD people should not only commit a port of mksh but replace their ksh with it (optionally retaining that GNU bash-like $PS1 stuff). The set -o emacs-usemeta command is no longer needed because the emacs editing mode has been changed for Unicode/UTF-8 mode, which adds a new set -o utf8-hack mode. The set -o sh command has been completely removed, set -o posix merely turns off brace expansion as side effect. There is no limit (well, 2³¹ probably) on array sizes any more. Many bugs and security holes have been closed in mksh and are still in oksh and OpenBSD ksh. The user interface has much less bugs and surprises; emacs editing mode is enabled by default. In contrast to oksh, set -o arc4random can be used to control which generator for $RANDOM is used.
mksh is the heir of pdksh and contains all the latest fixes from upstream (so ca. 1995) and Debian, except a change which breaks (at least) BSD make due to different errorlevel (return/exit code) handling. See above for other differences. The code really has been cleaned up and no longer contains any material under licences more restrictive than the BSD licence.
AT&T ksh88 and ksh93 compare to mksh substantially, but share no code; the user interface is slightly different especially for ksh88; many editing commands work (only slightly) differently as well. mksh implements many, but by far not all, ksh93 features, but most ksh88 features. No floating point. The last command of a pipeline is executed in a subshell.
mksh can do many things GNU bash can’t, for example better arrays, the ksh Co-processes, etc. but is much faster and smaller. In contrast to bash, mksh is still being actively developed (bash almost only receives small changes or weird stuff like programmable tab completion). GNU bash’s array initialiser syntax is not yet supported. We don’t aim at being fully bash compatible, but some of the surprises for converts will be removed.
The Z shell (zsh) isn’t even remotely ksh compatible in its “emulate ksh” operation mode, and we don’t compare to it.
mksh is mostly bourne shell compatible (but ^ as alias for | is
not supported, like most modern shells). mksh is also POSIX sh compatible.
Some constructs are not supported, for example
((foo; bar) 2>&1 || baz)
which has to be rewritten as
( (foo; bar) 2>&1 || baz)
because ((…)) is shell arithmetics;
brace expansion is turned on by default; etc.
mksh R33 supports even more bash/ksh93/zsh constructs than its predecessors; sometimes, not all cases (e.g. applying string trimming on arrays) are supported, but you probably will not notice that.
Official Testing
The MirOS Project has tested mksh on the following operating systems, asked people to test, and hunted mksh down in these packaging systems:
Current Release
- – tests by the project, using Makefile –
- MirOS #10-current (i386 gcc3.4.6)
- MirOS #10-current (sparc gcc3.4.6)
- – tests by the project, using Build.sh –
- MirOS #10-current (i386 pcc-20080709)
- MirOS #10-current (i386 pcc-20080717-MirPorts-0)
- MirOS #10-current (i386 SUNcc5.9 Linux_i386 2007/05/03, GNU ld 2.13.90.0.2 20020802)
- MirOS #7-stable (sparc gcc2.95.3-078E)
- BSDi BSD/OS 3.1 #4 M300-043 (i386 gcc2.7.2.1)
- BSDi BSD/OS 3.1 #4 M300-043 (i386 gcc1.42)
- DragonFly 1.9-DEVELOPMENT Feb 17, 2007 (i386 gcc3.4.6)
- FreeBSD 6.2-RELEASE (i386 gcc3.4.6-20060305)
- MidnightBSD 0.2-CURRENT (i386 gcc3.4.6-20060305)
- MidnightBSD 0.2-CURRENT (i386 pcc-20080717-MirPorts-0)
- NetBSD 3.0_STABLE (i386 gcc3.3.3_nb3_20040520)
- OpenBSD 4.3 GENERIC#207 (zaurus gcc3.3.5)
- DEC ULTRIX 4.5 0 RISC (mips cc3.0 ucode9.2)
- Mac OSX Leopard 10.5.4 (9E17) Darwin 9.4.0 (i386 gcc4.0.1-Apple_5480)
- Mac OSX Leopard 10.5.4 (9E17) Darwin 9.4.0 (i386 gcc4.2.1-Apple_5558)
- Mac OSX Leopard 10.5.4 (9E17) Darwin 9.4.0 (i386 llvmgcc4.2.1-Apple_5555-LLVM_2030)
- Mac OSX Leopard Server 10.5.4 (9E17) Darwin 9.4.0 (macppc gcc3.3-20030304-Apple_1823)
- Mac OSX Leopard Server 10.5.4 (9E17) Darwin 9.4.0 (macppc gcc4.0.1-Apple_5465)
- Mac OSX Leopard Server 10.5.4 (9E17) Darwin 9.4.0 (macppc cross-llvmgcc4.2.1-Apple_5555-LLVM_2039)
- Max OSX iPhoneOS 2.0 (N82AP) Darwin 9.3.1 (arm cross-gcc4.0.1-Apple_5484 Apple SDK)
- Max OSX iPhoneOS 2.0 (N82AP) Darwin 9.3.1 (arm llvmgcc4.2.1-Apple_5555 Saurik iphone-gcc 4.2-20080604-1-8)
- HP Tru64 OSF1 V5.1B 2650 (alpha Compaq C V6.5-011 Rev. 2650)
- HP Tru64 OSF1 V5.1B 2650 (alpha gcc2.97-tru64-010710 alphaev56)
- HP-UX 11i 11.11 B.11.11 U PA-RISC 9000/800 (hppa aCC HP92453-01, ld B.11.60 070209) without testsuite check
- HP-UX 11i 11.11 B.11.11 U PA-RISC 9000/800 (hppa gcc3.4.2 hppa2.0w) without testsuite check
- HP-UX 11i v3 B.11.31 U PA-RISC 9000/800 (hppa aCC HP92453-01, ld B.11.60 070209)
- HP-UX 11i v3 B.11.31 U ia64 (IA64 aCC B3910B A.06.14 [Feb 22 2007], ld 92453-07 B.12.43)
- Solaris 8 Generic_117350-41 sun4u (sparc gcc3.4.3)
- Solaris 8 Generic_117350-41 sun4u (sparc64 gcc3.4.3)
- Solaris 10 Generic_137111-02 sun4u (sparc gcc3.4.6)
- Solaris 10 Generic_137111-02 sun4u (sparc gcc3.4.6) + arc4random.c
- Solaris 10 Generic_137111-02 sun4u (sparc64 gcc3.4.6)
- Solaris 10 Generic_137111-02 sun4u (sparc:V8+ SUNcc5.9 124867-06 2008/06/10, ld 5.10-1.489)
- Solaris 10 Generic_137111-02 sun4u (sparc:V8+ SUNcc5.9 124867-06 2008/06/10, ld 5.10-1.489) + arc4random.c
- Solaris 10 Generic_137111-02 sun4u (sparc64 SUNcc5.9 124867-06 2008/06/10, ld 5.10-1.489)
- Interix 3.5 SP-8.0.1969.1 (i386 gcc3.3 win2k)
- Interix 3.5 SP-8.0.1969.1 (i386 msc CL.EXE 13.00.9466 (standard), LINK.EXE 7.00.9466)
- Interix 6 10.0.6030.0 (i386 gcc3.3 mistda) without testsuite check
- Interix 6 10.0.6030.0 (i386 msc CL.EXE 13.00.9466 (standard), LINK.EXE 7.00.9466) without testsuite check
- Debian GNU 4.0 sid GNU-Mach 1.3.99/Hurd-0.3 i686-AT386 (i386 gcc3.4.6-5)
- Debian GNU 4.0 sid GNU-Mach 1.3.99/Hurd-0.3 i686-AT386 (i386 gcc4.0.4-1)
- Debian GNU 4.0 sid GNU-Mach 1.3.99/Hurd-0.3 i686-AT386 (i386 gcc4.1.2-23)
- Debian GNU 4.0 sid GNU-Mach 1.3.99/Hurd-0.3 i686-AT386 (i386 gcc4.2.4-3)
- Debian GNU 4.0 sid GNU-Mach 1.3.99/Hurd-0.3 i686-AT386 (i386 gcc4.3.1-5)
- Debian GNU 4.0 sid GNU-Mach 1.3.99/Hurd-0.3 i686-AT386 (i386 gcc4.3.1-5) + arc4random.c
- Cygwin_NT-5.0 1.5.25(0.156/4/2) 2008-04-17 12:11 i586 win2kSP2 (i386 gcc3.4.4)
- Cygwin_NT-5.0 1.5.25(0.156/4/2) 2008-04-17 12:11 i586 win2kSP2 (i386 gcc3.4.4) + arc4random.c
- UWIN-NT 4.1.0/5.0 2195 2006-02-14 (i386 dmc DMC.EXE 8.42n, LINK.EXE OPTLINK 7.50B1)
- UWIN-NT 4.1.0/5.0 2195 2006-02-14 (i386 msc CL.EXE 13.00.9466, LINK.EXE 7.00.9466)
- Debian GNU/Linux 4.0 etch 2.6.18-6-mckinley (IA64 gcc4.1.1-21)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 gcc1:3.3.6-15)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 gcc4.1.1-21)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 dietlibc-0.30-4 gcc4.1.1-21)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 TenDRA-4.1.2)
- Debian GNU/Linux 4.0 testing 2.6.24-1-686 (i386 gcc3.4.6-7)
- Debian GNU/Linux 4.0 testing 2.6.24-1-686 (i386 gcc4.1.2-23)
- Debian GNU/Linux 4.0 testing 2.6.24-1-686 (i386 gcc4.2.4-2+b1)
- Debian GNU/Linux 4.0 testing 2.6.24-1-686 (i386 gcc4.3.1-2)
- Debian GNU/Linux 4.0 testing 2.6.25-2-686 (i386 llvmgcc4.2.1-Apple_5555-LLVM_r52845)
- Debian GNU/Linux 4.0 sid 2.6.18-6-vserver-s390x (S/390 gcc4.3.1-2)
- ecce!GNU/Linux 1.00 2.0.38a (i386 libc5 gcc2.7.2.3) except locale support
- Mandriva GNU/Linux CS 2006.0 2.6.12-22mdksmp (i386 gcc4.0.1-5mdk)
- Oracle Enterprise GNU/Linux 4 2.6.9-42.0.0.0.1.ELsmp (amd64 gcc3.4.6-3.1 Red Hat)
- Red Hat GNU/Linux RHEL5 2.6.18-8.1.6.el5 (amd64 gcc4.1.1-52)
- SuSE GNU/Linux SLES10 2.6.16.27-0.9-smp (amd64 gcc4.1.0)
- SuSE GNU/Linux SLES10 2.6.16.27-0.9-default (IA64 gcc4.1.0)
- – tests by the project, using ports –
- MirOS #10-current (i386 gcc3.4.6) via MirOS SRPM
- MirOS #10-current (i386 gcc3.4.6) via MirPorts Framework
- OpenBSD 4.3 GENERIC#207 (zaurus gcc3.3.5) via MirOS OpenBSD-Port
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 gcc4.1.1-21) via MirOS SRPM
- Debian GNU/Linux 4.0 testing 2.6.25-2-686 (i386 gcc4.3.1-2) libc6-2.7-10 + dietlibc-0.31-1 + libbsd-0.0-3) via MirOS Debian package
- – tests by third parties (Build.sh) –
- MidnightBSD 0.1.1-RELEASE (amd64 gcc3.4.4-20050518), by Lucas Holt
- HP OSF/1 V4.0F 1229 (alpha DEC C V5.9-005) by Jupp Schugt
- HP OSF/1 V4.0F 1229 (alpha gcc2.8.1 alpha-dec-osf4.0d) by Jupp Schugt
- SGI IRIX64 6.5 (mips:R10K mipspro7.4.4m) by Elias Pipping
- SGI IRIX64 6.5 (mips:R10K gcc3.4.1) by Elias Pipping
Development Versions older than last release
- – tests by the project, using Build.sh –
- MidnightBSD 0.1.1-RELEASE (sparc64 gcc3.4.4-20050518)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc1:3.3.6-15)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc3.4.6-6)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc4.0.3-7)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc4.1.2-19)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc4.2.3-2)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc4.3-20080227-1)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc4.3-20080227-1) + arc4random.c
- AIX 5.3 (powerpc gcc4.0.0_powerpc-ibm-aix5.1.0.0, LD 1.65 04/06/2005)
- AIX 5.3 32-bit (powerpc xlC9.0 070428, LD 1.65 04/06/2005)
- AIX 5.3 64-bit (powerpc xlC9.0 070428, LD 1.65 04/06/2005)
- HP-UX 11i v2 B.11.23 U ia64 (IA64 aCC B3910B A.06.10 [Mar 22 2006], ld 92453-07 B.12.45)
- HP-UX 11i v2 B.11.23 U ia64 (IA64 gcc3.4.3)
- Interix 3.5 SP-8.0.1969.1 (i386 msc CL.EXE 14.00.50727.42 (optimising), LINK.EXE 8.00.50727.42)
- Ångström GNU/Linux spitz 2.6.20.6 PREEMPT (armv5tel glibc2.5 gcc4.1.2)
- Debian GNU/Linux 4.0 etch 2.6.18-5-alpha-generic (alpha gcc1:3.3.6-15)
- Debian GNU/Linux 4.0 etch 2.6.18-5-alpha-generic (alpha gcc4.1.1-21)
- Debian GNU/Linux 4.0 sid 2.6.22-2-powerpc (macppc gcc4.2.2-3)
- SuSE GNU/Linux SLES10 2.6.16.27-0.9-default (IA64 icc9.1.046-20070111)
Older Releases
- – other build system integration –
- See the Inclusion section for general information
- Debian GNU/kFreeBSD 4.0 sid 7.0-1-586 (i386 gcc4.3.0-2) via MirOS provided Debian package
- Debian GNU/kFreeBSD 4.0 sid 7.0-1-586 (i386 gcc4.3.0-2) via MirOS provided SRPM package
- Debian GNU/Linux 4.0 etch 2.6.18-4-k7 (i386 gcc4.1.1-21) via MirOS provided Debian package
- Debian GNU/Linux 4.0 etch 2.6.18-4-k7 (i386 gcc4.1.1-21) via MirOS provided SRPM package
- Debian GNU/Linux 4.0 testing 2.6.22-3-686 (i386 gcc4.2.3-1) via MirOS provided Debian package
- Red Hat FC8 2.6.23.15-137.fc8 (i386 gcc4.1.2-33) via MirOS provided SRPM package
- Red Hat FC8 2.6.23.15-137.fc8 (amd64 gcc4.1.2-33) via MirOS provided SRPM package
- – tests by third parties (packagers) –
- Debian GNU/kFreeBSD 6.3-1-686 (i386 gcc4.3.0-2) by ganymede1 buildd via Debian’s package
- Debian GNU/kFreeBSD 6.3-1-amd64-k8 (amd64 gcc4.3.0-2) by ganymede2 buildd via Debian’s package
- Mac OSX Leopard 10.5.2 Darwin 9.2.0 (i386 gcc4.0.1 Apple Inc. build 5465) by gecko2 via Fink package
- Debian GNU GNU-Mach 1.3.99/Hurd-0.3 i686-AT386 (i386 gcc4.2.2-4) by beethoven buildd via Debian’s package
- Debian GNU/Linux 2.6.18-4-alpha-generic (alpha gcc4.2.3-3) by goetz buildd via Debian’s package
- Debian GNU/Linux 2.6.22-3-vserver-amd64 (amd64 gcc4.2.3-3) by excelsior buildd via Debian’s package
- Debian GNU/Linux 2.6.18sam armv4l (arm gcc4.3.0-1) by grieg buildd via Debian’s package
- Debian GNU/Linux 2.6.24-1-iop32x armv5tel (armel gcc4.3.0-2) by arcadelt buildd via Debian’s package
- Debian GNU/Linux 2.6.22-14-hppa64 (hppa gcc4.2.3-2) by bld-3 buildd via Debian’s package
- Debian GNU/Linux 2.6.24.1 (i386 gcc4.2.3-2) by ninsei buildd via Debian’s package
- Debian GNU/Linux 2.6.18-dsa-mckinley (IA64 gcc4.3.0-2) by mundy buildd via Debian’s package
- Debian GNU/Linux 2.6.24-1-mac (mac68k gcc4.2.3-2) by zeus buildd via Debian’s package
- Debian GNU/Linux 2.6.25-rc3-00000-g84d8498-dirty (mips gcc4.3.0-2) by mayr buildd via Debian’s package
- Debian GNU/Linux 2.6.24.1 (mipsel gcc4.3.0-2) by rem buildd via Debian’s package
- Debian GNU/Linux 2.6.8-powerpc-smp (macppc gcc4.3.0-2) by voltaire buildd via Debian’s package
- Debian GNU/Linux 2.6.18-5-s390x (S/390 gcc4.3.0-2) by debian-31 buildd via Debian’s package
- Debian GNU/Linux 2.6.23.16 (sparc64,V8 gcc4.3.0-2) by lebrun buildd via Debian’s package
- Fedora GNU/Linux Core 7 2.6.18-53.1.6.el5 (macppc64 gcc4.1.2-27 Red Hat) by ppc3 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 7 2.6.18-53.1.6.el5xen (i386 gcc4.1.2-27 Red Hat) by xenbuilder4 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 7 2.6.18-53.1.6.el5xen (amd64 gcc4.1.2-27 Red Hat) by xenbuilder2 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 7 2.6.18-53.1.6.el5 (macppc gcc4.1.2-27 Red Hat) by ppc4 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 8 2.6.18-53.1.6.el5 (macppc64 gcc4.1.2-33 Red Hat) by ppc2 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 8 2.6.18-53.1.6.el5xen (i386 gcc4.1.2-33 Red Hat) by xenbuilder4 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 8 2.6.18-53.1.6.el5xen (amd64 gcc4.1.2-33 Red Hat) by xenbuilder2 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 8 2.6.18-53.1.6.el5 (macppc gcc4.1.2-33 Red Hat) by ppc4 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 9 2.6.18-53.1.6.el5 (macppc64 gcc4.3.0-5 Red Hat) by ppc4 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 9 2.6.18-53.1.6.el5 (i386 gcc4.3.0-5 Red Hat) by hammer2 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 9 2.6.18-53.1.6.el5xen (amd64 gcc4.3.0-5 Red Hat) by xenbuilder1 buildd via Koji/EPEL packager
- Fedora GNU/Linux Core 9 2.6.18-53.1.6.el5 (macppc gcc4.3.0-5 Red Hat) by ppc1 buildd via Koji/EPEL packager
- Red Hat GNU/Linux RHEL 4 2.6.18-53.1.6.el5 (i386 gcc3.4.6-9 Red Hat) by hammer2 buildd via Koji/EPEL packager
- Red Hat GNU/Linux RHEL 4 2.6.18-53.1.6.el5 (macppc gcc3.4.6-9 Red Hat) by ppc2 buildd via Koji/EPEL packager
- Red Hat GNU/Linux RHEL 4 2.6.18-53.1.6.el5 (amd64 gcc3.4.6-9 Red Hat) by hammer2 buildd via Koji/EPEL packager
- Red Hat GNU/Linux RHEL 5 2.6.18-53.1.6.el5 (i386 gcc4.1.2-14 Red Hat) by hammer2 buildd via Koji/EPEL packager
- Red Hat GNU/Linux RHEL 5 2.6.18-53.1.6.el5 (macppc gcc4.1.2-14 Red Hat) by ppc2 buildd via Koji/EPEL packager
- Red Hat GNU/Linux RHEL 5 2.6.18-53.1.6.el5 (amd64 gcc4.1.2-14 Red Hat) by hammer2 buildd via Koji/EPEL packager
- Fedora GNU/Linux Extras 6 2.6.16.46-0.7-xen (i386 gcc4.1.1-30 Red Hat) by build13 buildd via the openSUSE Build Service
- OpenSuSE GNU/Linux 10.2 2.6.16.46-0.7-xen (i386 gcc4.1.2-20061115 SuSE) by build18 buildd via the openSUSE Build Service
- OpenSuSE GNU/Linux 10.2 2.6.16.46-0.7-xen (amd64 gcc4.1.2-20061115 SuSE) by build15 buildd via the openSUSE Build Service
- OpenSUSE GNU/Linux 10.3 2.6.16.46-0.7-xen (i386 gcc4.2.1 SuSE) by build12 buildd via the openSUSE Build Service
- OpenSUSE GNU/Linux 10.3 2.6.16.46-0.7-xen (amd64 gcc4.2.1 SuSE) by build19 buildd via the openSUSE Build Service
- SLES GNU/Linux 9 2.6.16.46-0.7-xen (i386 gcc3.3.3 SuSE) by build19 buildd via the openSUSE Build Service
- SLES GNU/Linux 9 2.6.16.46-0.7-xen (amd64 gcc3.3.3 SuSE) by build10 buildd via the openSUSE Build Service
- SuSE GNU/Linux 10.1 2.6.16.46-0.7-xen (i386 gcc4.1.0 SuSE) by build02 buildd via the openSUSE Build Service
- SuSE GNU/Linux 10.1 2.6.16.46-0.7-xen (amd64 gcc4.1.0 SuSE) by build10 buildd via the openSUSE Build Service
- SuSE GNU/Linux Factory 2.6.16.46-0.7-xen (i386 gcc4.3.0 SuSE) by build13 buildd via the openSUSE Build Service
- SuSE GNU/Linux Factory 2.6.16.46-0.7-xen (amd64 gcc4.3.0-20080221-r132521 SuSE) by build13 buildd via the openSUSE Build Service
- – even older versions –
- See the old-mksh site
Known to FAIL Build or Test
- UWIN-NT 4.1.0/5.0 2195 2006-02-14 (i386 bcpp BCC32.EXE 5.5.1, ILINK32.EXE 5.00) does not really work except a few basic commands
- Fabrice Bellard’s tcc in combination with GNU libc often fails linking
with an error message like this:
/usr/lib/libc_nonshared.a: '__i686.get_pc_thunk.bx' defined twice (eg. Debian etch tcc0.9.23) - mksh works on Plan 9, but does not return after executing a non-builtin command. Syllable Desktop exhibits the same behaviour.
- mksh does not correctly work on Minix 3 at all.
Recommendations on version numbering
mksh by default uses a version numbering scheme that uses full integers, prefixed by a capital letter R significing “Release”. If minor updates are required or requested, a lower-case letter from the standard latin alphabet will be appended, starting at ‘b’ and ending at ‘z’ (but usually way before or at ‘i’). If a packaging system cannot handle version numbers such as mksh-R29b (source) → mksh-R29b-1, mksh-R29bp1 (binary), packagers OUGHT TO map this to a numerical system as follows: mksh-29.2-1, mksh-29.2.1, mksh-29.2nb0, depending on the packaging-system local policy for build numbers / patchlevels.
Schemes to AVOID are mirbsdksh-1.29b, mksh-2.9.2, or worse. Please adhere to our recommendations so that users are able to locate mksh in their operation environment of choice.
/bin/ed
While we’re at it – recommendations for packagers – there is another set of do’s and dont’s: location of the UNIX® standard text editor. As outlined in traditional unixoid operating system standards, manifested into POSIX, and – for these three-letter words that aren’t Unix, no matter which of the kernels they use in their variety of so-called distributions – the FHS (FSSTND): ed lives in /bin/ed, period.
Patching mksh’s to look for ed in ANY other location is a MUST NOT.
Future Plans
- when typing then moving in the history, push current (eventually even empty) line into history buffer first, so that, when we go down the history again, do not lose what was typed first; ignore dups and spaces
- bash-style multiline command line editing, as an option (the current horizontally scrolled one is finally (with R28) bug-free even with multiline and very long prompts optionally with embedded newlines, and more suitable for small terminals)
- I’d like to switch the internal integer type to 64 bits signed (any takers?). This includes 2⁶⁴-1 (not 2³¹-1) as maximum valid array index; typeset -i<number> is unsigned (or probably not? stay signed in most places for compatibility)
- Adding goto and label keywords/commands
- Adding builtins fstat, lstat, traverse, …
- for a b in …; do (like make(1) does)
- ${foo:S/bar/baz/g} ${foo:C/bar/baz/x}
- A sensible website
- Build and actually work on more platforms – PW32, Minix 3, Plan 9, Syllable – debug these
- Build with more platforms’ native tools or other compilers – ACK, kencc, ICC/UWIN, egcs/UWIN, tcc
- Add the ability to handle embedded NUL bytes in strings read,
for example in the hexdump “utility” (regression test)
XXX this might be a bad idea actually, cf. php’s insecurity - Bugfix for suspending a && b chain
Recent Changes
Changes in the current (unreleased) development version:
- Begin porting mksh to the Plan 9 ANSI’n’POSIX Environment (not finished)
- Plan porting mksh to Minix 3 (not finished yet)
- Port to Syllable (much improved; support now en par with Plan 9’s, thanks to Anthony Morphett <awmorp@gmail.com> – maybe the rest is a kernel bug?)
- Fix Build.sh invocation without ‘-r’, 10x Elias Pipping
- Mention the MirOS OPTU-8 and MirOS OPTU-16 encodings in the manual page, now that we have a name for it
- In the MirOS base installation via Makefile (and not via Build.sh, run with -DMKSH_AFREE_DEBUG (unless ramdisc or MirOS-stable or formal release, i.e. DEBUGLIBS is not set)
- Merge final version of jaredy’s fix for the stack-storage free issue
mksh R35b comes with the following bug fixes:
- IRIX also has no UTF-8 locale at all, confirmed by Elias Pipping
- Fix regression test suite for MKSH_SMALL
- Bring in latest changes from oksh (OpenBSD ksh, not DeliLinux crap)
- Fix abuse and unsafe use of str_save() and str_nsave()
- Optimise the implementations of str_save() and str_nsave()
- If MKSH_AFREE_DEBUG is defined, guard against afree()ing a pointer which has not been allocated from the given pool, from Todd C. Miller
- Fix attempt to free a pointer to stack (function-local) storage when redefining a function containing a call to the “time” built-in, discovered by Elias Pipping, patch by Jared Yanovich, help from Todd C. Miller
- Protect a little against people not running “./test.sh -v” but calling it with, for instance, GNU bash (as homsn did…)
- Honour $PERL environment variable in test.sh, improve scanning for Perl, do not use potentially undefined $^O, print Perl version
- Add <sys/types.h> as <ulimit.h> requirement (dietlibc)
- Work around bug in BSD/OS 3.1 /bin/ksh (PD KSH v5.2.8 96/08/19)
- Add regression tests from OpenBSD’s <bsd.regress.mk> suite
- Use better CPPFLAGS for AIX, Minix 3 (from pdksh)
- Expose the “s ≠ NULL” str_[n]save_() API and use it where the string can never be NULL (local stack storage), from gcc-4.2 warnings
- Clean up pointer-to-integer-cast warnings in the mirtoconf process
mksh R35 comes with helluva changes:
- Simplify and refactor the ulimit builtin, partially from oksh
- Some style cleanup; use appropriate integer types
- Fix a bug in table (e.g. kill -l, tab completion) display: the width of non-ASCII characters is now honoured in the utf8-hack mode
- Improve handling of invalid UTF-8 in certain areas, and multibyte (UTF-8 / CESU-8) in general
- When using “typeset -Z«n»” on an integer variable with a base other than ten, zero-pad the value instead of the base – pdksh, oksh, zsh, and AT&T ksh93 are wrong here; GNU bash doesn’t even have typeset
- Improve parsing of “set +o” output where done (dot.mkshrc, check.t)
- Improve regression tests
- Support for base-1 numbers: in non-utf8-hack mode, ‘1#x’ means the same as the ASCII code for ‘x’ (e.g. 78hex), where ‘x’ is any single octet (byte); in utf8-hack mode, ‘x’ is either a valid and minimalistically encoded UTF-8 multibyte character in the range 0000‥FFFD, or a single octet with no trailing octets (bytes), which will then be converted as if it were an ASCII value, or, if bit7 is set, be mapped into the PUA range of EF80‥EFFF assigned by CSUR for this purpose; this mapping is, in both cases, bidirectional; the planned base-0 number support is not possible with the code, so use base-1 (with utf8-hack disabled, or & 0xFF) instead (while it is recommended to parse only single octets, there is a regression test showing correct and safe multibyte parsing, which however is error-prone to implement and thusly not recommended) – “genial” replaced@TNG, “this sounds fun” ggergely, agreed bsiegert@ and others
- Pull in more current versions of supplied files; use Unicode 5.0
- Clean up unused definitions in build system; document MKSH_CLS_STRING
- Remove advertising clause from copyright file; while we’d be pleased to be mentioned if something contains our code, tg@ will no longer enforce the requirement to advertise with that specific formula, and we’d prefer if people remember the OpenHAL vs ath5k incident and that they cannot simply change licencing of existing code; patches sent to the MirOS Project for inclusion shall be accepted if they’re agreed to match this licence
- Simplify dot.mkshrc sample file: licence is merged into the main copyright file; AT&T ksh93 compatibility was improved
- Fix a display problem regarding fullwidth characters (e.g. CJK)
- Set the “C” locale in Build.sh for tool execution; otherwise, certain OEs behave strange; thanks to Adam “replaced” Hoka for spotting
- Use en_US.utf8 as UTF-8 locale for the testsuite for now
- If setlocale(LC_CTYPE, "") is not available, look at the environment variables ourselves – brings UTF-8 support to poor OSes
- Remove some now-dead code; speed up configuration process; shrink
- Default to no setlocale(3) due to stubbed or missing locale support on GNU/Cygwin, OpenBSD, OSF/1 in Build.sh; a few more that are quite unlikely to have a UTF-8 locale: BSD/OS, Interix, Minix, PW32, Ultrix, AT&T UWIN; default to always UTF-8 on Plan 9
- Fix for testsuite unexpected failure if running as root in one case
- Initialise all shell integer variables (OPTIND, PPID, RANDOM, SECONDS, TMOUT) to base 10
- Reintroduce from mksh pre-R24 shell integer variable PGRP set to the PID of the process group leader via getpgrp(2)
- New shell integer variable USER_ID set to the geteuid(2) and used by dot.mkshrc to speed up logins, saves a spawn of id(1), mentioned by and realisation planned with Andreas "gecko2" Gockel
- Fix dot.mkshrc tilde replacement in both $PS1 and the pushd/popd/dirs implementation when the home directory is empty, the root directory, or ends with a slash (disable replacement in that case)
- Support dietlibc, force it into providing a BSDish caddr_t
- Do not use LDFLAGS and LIBS while compiling with -c
- Add realpath(3) builtin, to further speed up logins and chdirs
- Optimise the code somewhat by making use of possible assumptions
- Set the “C” locale in test.sh as well to quell warnings
- Split the regression tests that use locale between en_US.utf8 and en_US.UTF-8, since not all OSes support either one, and make only HP-UX and GNU use the latter
- Fix kill, mknod(8) builtin usage msg, from Igor Sobrado via oksh
- Use proper ptrdiff_t casts for pointer arithmetics, inspired by an oksh commit from Federico Schwindt
- Remove check category “pdksh” from check.t and test script
- Improve Darwin, OSF/1, HP aCC, SUNpro version reporting
- Support GNU bash “&>” extension, even better than they do, suggested by Lukas “smultron” Upton from MidnightBSD
- Basic support for LLVM+clang in the build system with experimental “ccc” compiler driver; llvm-gcc worked as-is before already
- Better support for contributed arc4random.c file
- Do not spin if unlink(2) fails on $HISTFILE, from Decklin Foster
- Dump the perl(1) $^O variable in test.sh to logs
- Pull in latest changes from oksh
- Allow white space between a here string indicator and the string, accidentally discovered by twkm (#ksh, freenode)
- Allow fd specifications outside the 0‥9 range for I/O redirections, and bounds check them to be lower than the FDBASE definition, currently still 10 if MKSH_SMALL, 24 otherwise (unportable)
- Improve the regression test suite: for one test, we had a bizarre constraint telling it won’t work on UWIN, which was based upon false assumptions, but Tru64 would fail it since its cat(1) unexpectedly outputs some error messages (fix by closing stderr for cat); another test would unexpectedly print no error message on Solaris (fix by making the error message optional in the perlre(1) used)
- Switch back to en_US.UTF-8 for glibc, Debian can do both, Mandriva fails on en_US.utf8 (XXX no libc5 auto-detection to disable it)
mksh R33d is a quick security-update with these changes:
- Move a portability define from sh.h to the setmode.c helper, as it’s only needed there, and we want to use the latter from MirMake as well
- SECURITY: when spawning mksh on a new terminal, for example with sudo mksh -lT/dev/ttyC7, flush all of that tty’s I/O first
- dot.mkshrc: ensure “ls” is no alias, don’t hardcode its path
mksh R33c issues fixes for the following issues:
- Handle Ultrix mmap(2) having a different prototype (returning a caddr_t instead of a void * and not defining MAP_FAILED; making Ultrix 4.5 a fully supported platform
- Decrease code size and optimise (using puts-style functions instead of printf-style functions for fixed strings; bool instead of int)
- Correct behaviour of “export”, “export -p”, “readonly”, “readonly -p”, “typeset”, “typeset -p”, “typeset” and their respective descriptions in the manual page; problem reported by Danijel Tasov
- Work around dup2(2) problem (preserving the close-on-exec flag) on Ultrix using code from mirbsdksh-1.11, lost in oksh
- Clean up Build.sh a little more
- Correct quotes and some other stuff in the regression tests; fix for running with old Perl (5.002 or so, Linux 2.0, BSD/OS)
- Export the new “__progname” and “__perlname” environment variables to the suite run from check.t in check.pl
- Do not mistake IBM xlC and VisualAge for different things, thanks to Pascal “loki” Bleser from OpenSuSE for information on them
mksh R33b comes with the following minor fixes:
- Fix some minor code issues remarked by MIPSpro
- Port to SGI IRIX 6.5 (uname: IRIX64) using gcc and MIPSpro
- Scan for a lot more compilers; add support for MIPSpro
- Ignore if the OS doesn’t define MAP_FILE for mmap(2)
- Use sys/types.h as sys/mkdev.h dependency
- Enable OSF/1 V2.0 /bin/sh to run Build.sh
- Add strcasecmp(3) proto for Ultrix 4.5 only (imake style)
- Add S_ISLNK if the OS doesn’t define it
- Use tempnam(3) if mkstemp(3) not found – not recommended
- Reduce dependency on certain OE facilities: printf(1), fgrep(1) being able to scan for two patterns at the same time, perl5 being named perl
- New -T- option for dæmonisation, cf. man page
- Port to BSDi BSD/OS 3.1 (gcc 1.42 and gcc 2.7.2.1 supported)
- Simplify the dot.mkshrc file and make it more robust
- Report OE and $CC version in Build.sh, for logs
- Fix look’n’feel of the mksh(1) manual page, so that it still looks best in AT&T nroff(1), looks much better in GNU groff (the PDF version we place on the website), and looks some better and gains the ability to copy’n’paste from it for GNU gnroff -Tutf8, originally prompted by Patrick “aptituz” Schoenfeld and “lintian -viI mksh*.changes”, but then improved (and nroff hacked) by tg@ a lot
- Shut up some gcc warnings (explicit braces; cast MAP_FAILED)
- Try to get rid of the test “if the compiler fails correctly” by using the errorlevel of the $CC process (except with Microsoft Visual C++ which returns non-zero even on success sometimes), thus supporting DEC C on OSF/1 (and, quite possibly, gcc3 on Mac OSX Leopard)
- If revoke(2) and flock(2) are found, check if they’re declared
- Promote Tru64 to a fully supported operating environment, even though it needs a plethora of _*_SOURCE defines and has SIGMAX instead of NSIG; OSF/1 V4.0 and Tru64 (OSF/1 V5.1) are supported with both gcc and HP/Compaq/DEC C in various versions
- Generalise the workaround for incompatible sig_t across the platforms that need it (currently, OSF/1 and PW32)
- Shut up annoying warning about gcc 2.7.2.3, 2.8.1, 2.95.x not knowing the “-std=gnu99” and “-std=c99” options without setting proper errorlevel
A release with many new features is mksh R33, look yourself:
- Sync with OpenBSD ksh (no real functional changes)
- Enhance the print builtin with two new escape sequences: \xAB parses the next up to two hexadecimal digits AB and outputs a raw octet (byte) whose ordinary value is AB; \uABCD parses up to four hexadecimal digits and outputs the UTF-8 (CESU-8) representation of the unicode codepoint U+ABCD from the BMP (Basic Multilingual Plane), not depending on the locale
- The . (“dot”) command (and its counterpart source) needs an argument (the script to source); from Debian pdksh package
- In the lexer, do not expand aliases if there is an opening parenthesis just after the token (from Debian pdksh). This fixes the namespace issue that caused a POSIX function definition stop() { … } to fail due to “stop” being a built-in Korn shell alias. Now, aliases are removed when a POSIX function with the same name is defined; Korn functions are still different: their definition does not fail, but the alias retains its precendence (unchanged behaviour)
- Accordingly, do not disable built-in aliases in POSIX mode any more
- Since POSIX mode now only turns off braceexpand mode (which can then be turned back on), do not handle being called as -sh or sh specially any longer
- Clean up the source code: make some constants private to the only file using it; optimise; comment some code; improve portability with regards to stupid tools in /usr/bin (or /usr/xpg4/bin) and foreign compilers
- Implement “here strings” (like ksh93 or zsh; GNU bash collapses white
space if the string is not double-quoted): you can now replace print
-r -- "$foo" | command with command <<<"$foo" with
the very same semantics as command <<EOF
$foo
EOF (stripping initial tabs is not possible) - Implement string replacement ${var/pattern/string} (where pattern is an extended glob pattern), like GNU bash; like with the substring accessor (${var: x: y}) mksh implements almost all corner cases (and double slash), but do not handle trimming arrays yet
- Side note: You can now, as a consequence of the two items above, write, for instance, x=${x//foo*bar/baz} instead of the more complicated x=$(sed -e 's/foo.*bar/baz/g' <<<"$x") or the mksh R32 and before idiom x=$(print -r -- "$x" | sed -e 's/foo.*bar/baz/g') – be sure to check $KSH_VERSION first though
- Use the new $Mdocdate$ RCS keyword in the manual page mksh(1) as well; since this is not portable in tmac.doc especially to GNU groff, prepend a seven-liner implementing it to the .Dd macro
- Fix a mistake in using the .Nm macro in the manual page
- Make Build.sh and the generated test.sh more chatty about what they’re doing and what versions (aids debugging build logs)
- Update the dot.mkshrc sample and make it more portable; it requires mksh R33 or above now though due to use of special functions
- Enhance the website, especially the section about official testing: now, the tests are split into tests done by us via Makefile (MirOS only), Build.sh (portably), porting frameworks, with arc4random.c added, tests by others via Build.sh, via packaging frameworks, failed tests; more links
- Note: the “vi” editing mode is code of historical value and, at the moment, unmaintained. It does not benefit from the fixes to the “emacs” editing mode (horizontal scrolling) or new features (bind keys that end their sequence with a tilde; UTF-8 support). Neither is it supported in either editing mode to bind keys that generate a sequence consisting of more than just a prefix (ESC, ^X, or ESC [), another octet and (“emacs” only) an optional tilde (but this might come in the future). This is explicitly mentioned here due to a user inquiry.
Sported by mksh R32 are these changes:
- Make checks for symbol declarations compile checks instead of link checks, as the binding may not succeed due to different symbol types, for instance on AIX, if the declaration does not match
- Widen the range of array indices to [0‥2³²-1], with negative values being mapped into the high-bit31 range for simplicity
- Fix the pipeline-as-coprocess internal error
- Do not require certain integer types to be defined any more
- Optimise the code and reduce its RAM usage
Everyone should upgrade to mksh R31d with fixes for…
- Support pcc (the ragge version of the Portable C Compiler)
- Add pushd/popd/dirs functions (csh) and precmd/chpwd hooks (zsh) to dot.mkshrc which now requires readlink(1) with -f; requested by many (e.g. some Gentoo users; XTaran of symlink.ch)
- Enable colour escapes in dot.mkshrc since almost nobody groks how to do it right from the manual
- Remove -DMKSH_NEED_MKNOD checks from Build.sh, people should use the HAVE_MKNOD environment variable
- Implement parallel make in Build.sh
- Fix another busy-loop spinning problem introduced by an icc warning, thanks to spaetzle@freewrt.org for keeping to bug me to look for it, as it affected GNU/Linux most, followed by Solaris, rarely BSD
- Improve standard integer type detection in Build.sh
- Cleanups in code, build script and manual page
The mksh R31c (Solaris-only) upgrade for cnuke@ was caused by:
- Clean up Build.sh and “test … -o …” doesn’t exist in Bourne
- Detect if the non-standard u_int32_t type, which was unfortunately used by the OpenBSD project in designing the standard arc4random(3) API, is present (which it isn’t on Solaris), and, if not, emulate it using the standard uint32_t (ISO C99) from <stdint.h>, which we fake as needed (if the standard integer types are not present, e.g. on PW32 and OSF/1); change mksh as well as the arc4random.c contribution to not use these non-standard types
- Remove unused types from the faked <stdint.h> file
A quick upgrade, mksh R31b with major bug fixes:
- Fix typo (blsk → bksl) in check.t test naming
- Autoscan for uint32_t, u_int etc. presence
- Fix some memory leaks, mostly by NetBSD® via OpenBSD
- The “unset” builtin always returns zero, even if the variable was already unset, as per SUSv3 (reported by Arkadiusz Miskiewicz via pld-linux → oksh)
- In tab-completion, escape the question mark, reminded by cbiere@netbsd.org, via oksh
- Fix a busy-loop problem, Debian #296446 via oksh
- Fix a few display output problems in the build script
- Shut up some gcc warnings on Fedora; beautify some code
- Support OSF/1 with gcc2.8, thanks to Jupp Schugt
- Fix gcc4 detection of __attribute__() on non-SSP targets
mksh R31 was released as part of MirOS #10 with these news:
- Support the TenDRA compiler (possibly also Ten15, not tried)
- Begin supporting Fabrice Bellard’s Tiny C Compiler (tcc on Debian cannot link due to duplicate symbols in GNU libc, thus unfinished)
- Improve some mirtoconf checks (most notably, mknod(2) and macros)
- Add new emacs editing command “clear-screen” (ESC ^L) as requested by D. Adam Karim <archite@midnightbsd.org>
- Support building for MidnightBSD
- Add new shell alias “source”, semantics like the GNU bash builtin
- Add new shell option “set ±o arc4random”, controlling whether rand(3) or arc4random(3) is used for the $RANDOM value, use arc4random_pushb(3)
- Add new builtin “rename” (just calls rename(2) on its arguments)
- Fix the inofficial OpenBSD port, from D. Adam “Archite” Karim, 10x
- Disable the less(1) history file by default (privacy issues) in the sample dot.mkshrc file; mention other things in etc_profile
- Fix a syntax error in Build.sh checking for TenDRA
A milestone in development: mksh R30 can do this:
- Build on and for Solaris, Linux and MirBSD with Sun’s C compiler
- No longer build a statically linked shell by default; do not try, do not provide any means; user has to use LDFLAGS instead
- Remove some probably dead mirtoconf checks
- Remove commented out -fwhole-program --combine check and still active -fno-tree-vrp bug workaround thing, the latter because the bug seems to only appear for functions that also exist as a builtin (which was declared with the nonnull attribute)
- Fix a long-standing typo, 10x moritz@obsd
- Prefer more common signal names (SIGCHLD) over uncommon ones (SIGCLD)
- Quieten gcc and support SUNpro 5.8 on Solaris 10 on sparc64
- Optimise signal handling and detection; enable compilers whose præprocessor doesn’t have -dD to generate list of signals
- Optimise mirtoconf meta-checks for persistent history etc.
- Fix a bug preventing manual page generation on Solaris
- Add support for the Intel® C Compiler and quieten it a little; fix a few minor buglets (mostly type conversion) its too verbose warnings show, as well as some errno ab-/mis-use
- Remove support for honouring the CPP environment variable; $CC -E - is simply used instead in the places where $CPP was used previously, because that was used in other places already, and to prevent it from behaving differently from the $CC used
- If a file called arc4random.c is lying around in the source directory at mirtoconf time, scan for <sys/sysctl.h> and use the file if arc4random(3) isn’t found otherwise. From Debian.
- If the basename of argv[0] starts with “sh”, activate FPOSIX early, preventing some typical ksh aliases from being defined
- If FPOSIX, don’t pre-define aliases (except integer and local) to benefit operating environments that never heard of the great Korn Shell…
- #if defined(MKSH_SMALL) || defined(MKSH_NOVI) disable the vi editing mode
- Don’t try to execute ELF, a.out, COFF, gzip or MZ binaries
- Can be built on HP-UX (PA-RISC and IA64) with gcc or HP C/aC++
- Support x=(a b c) bash-like array initialisation
- Support ${foo:2:3} bash-like substring expansion
- Many mirtoconf improvements, fixes; speed-up; better portability
- Enable compilation using Microsoft C/C++ Standard Compiler
- Add UWIN build target using various compilers with the cc wrapper
- Fix struct padding mistakes uncovered by the Microsoft compiler
- Fix double initialisation / unused value assignment errors unveiled by Borland C++ Builder 5.5
- Fix superfluous code detected by gcc 4.2
- Fix large file support for OSes that require CPPFLAGS contains -D_FILE_OFFSET_BITS=64 – it was detected but not actually used in the build; thanks to hondza for the problem report!
- Give the lexer a bigger state stack if !MKSH_SMALL
- Prepare for addition of make(1)-style search/replace operations; correct the code for other substitution expansion operations
- Default $CC to cc not gcc, this is no non-unix-ware ☺
- Support AIX with gcc and xlC; clean up code to warning-free
- Prefer well-known signal names to alphabetically earlier ones
- Fix a bug delivering ERR and EXIT pseudo-signals to traps combined with “set -e”, thanks Clint Pachl and Otto Moerbeek for the hint
