mksh – old versions
This page lists information about mksh R29 and earlier.
Old news
No news yet anyway… stay tuned.
Old instructions
Compilation
Accepted arguments to Build.sh are:
- -d (R29 and below): build dynamically, don't try to link with -static by default on architectures that support it
- -nd (R29 and below): build statically, always try to link with -static even on systems with nsswitch/PAM
- -q (all versions): output almost nothing
- -r (all versions): don't try to build a pre-formatted version of the manual page using nroff(1) if found
These special values in CPPFLAGS are recognised:
- -DMKSH_NEED_MKNOD – if MKSH_SMALL is set, do not omit the mknod(8) builtin functionality from the binary; deprecated, use the environment variable HAVE_MKNOD=[0|1] to determine if this builtin should be compiled in or not instead; has been removed past R31c
The build script also honours the following environment variables:
- CPP ($CC -E -) – the C præprocessor used
Hints and other useful stuff
mksh does not write a history file by default any longer; set the
environent variable HISTFILE in ~/.mkshrc (or the
profile) if you want this. The history file format of mksh (and oksh
and pdksh) differs from that of other shells, so you might want to
use a construct like
case $KSH_VERSION in
*MIRBSD\ KSH*) export HISTFILE=~/.mksh-history ;;
*PD\ KDH*MirOS*) export HISTFILE=~/.oldmksh-history ;;
*PD\ KSH*) export HISTFILE=~/.pdoroksh-history ;;
?*) export HISTFILE=~/.ksh-history ;;
*) export HISTFILE=~/.nonksh-history ;;
esac
to avoid them overwriting each others' history file.
Very old sample: this
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:
- mksh R33a-d
- Interix 3.5 SP-8.0.1969.1 (i386 gcc3.3 win2k) via MirOS provided pkgsrc® source package
- mksh up to R32
- MirOS #10 RC7 (i386 pcc20071025) optimisation disabled
- MirOS #10 RC6 (sparc gcc3.4.6)
- MirOS #10 RC2 (i386 gcc3.4.6)
- MirOS #10 RC1 (i386 SUNcc5.9 Linux_i386 2007/05/03, GNU ld 2.13.90.0.2 20020802)
- MirOS #7-stable (sparc gcc2.95)
- AIX 5.3 (powerpc gcc4.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 B.11.11 (PA-RISC gcc3.4.2) no regression test run
- HP-UX 11i B.11.11 (PA-RISC hpC B.11.X.36086-36089-36092.GP, ld B.11.60 070209)
- HP-UX 11i B.11.23 (IA64 gcc3.4.3)
- HP-UX 11i B.11.31 (PA-RISC hpC B.11.X.36086-36089-36092.GP, ld B.11.60 070209)
- HP-UX 11i B.11.31 (IA64 hpC B3910B A.06.14 [Feb 22 2007], ld B.12.43 92453-07)
- Interix 3.5 (i386 gcc3.3 win2k) with Perl from pkgsrc®
- Interix 3.5 (i386 msc CL.EXE 13.00.9466 (standard), LINK.EXE 7.00.9466)
- Interix 3.5 (i386 msc CL.EXE 14.00.50727.42 (optimising), LINK.EXE 8.00.50727.42)
- Cygwin 1.5.19(0.150/4/2) 2006-01-20 13:28 (i386 gcc3.4.4 win2k)
- Solaris 8 Generic_117350-41 (sparc,V8+ sun4u gcc3.4.3)
- Solaris 8 Generic_117350-41 (sparc64,V9 sun4u gcc3.4.3)
- Solaris 10 Generic_125100-04 (sparc,V8+ sun4u gcc3.4.6)
- Solaris 10 Generic_125100-04 (sparc64,V9 sun4u gcc3.4.6)
- Solaris 10 Generic_125100-04 (sparc,V8+ sun4u SUNcc5.8 121015-04, ld 5.10-1.482)
- Solaris 10 Generic_125100-04 (sparc64,V9 sun4u SUNcc5.9 124867-01, ld 5.10-1.486)
- ecce!GNU/Linux 1.00 2.0.38a (i386 libc5 gcc2.7.2.3)
- FreeWRT GNU/Linux 1.1/trunk 2.4.34 (mipsel uClibc/brcm cross-gcc3.4.4)
- FreeWRT GNU/Linux 1.1/trunk 2.6.19.1 (mipsel uClibc/rb cross-gcc3.4.4)
- FreeWRT GNU/Linux 1.1/trunk 2.6.19.1 (i386 uClibc/WRAP cross-gcc3.4.4)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 gcc4.1.1-21)
- Debian GNU/kFreeBSD 4.0 sid 6.2-1-686 (i386 gcc4.2.1-5)
- Debian GNU 4.0 sid GNU-Mach/1.3.99 Hurd/0.3 (i386 gcc4.1.2-7)
- DragonFly 1.9-DEVELOPMENT Feb 20, 2007 (i386 gcc3.4.6)
- NetBSD 3.0_STABLE (i386 gcc3.3.3)
- NetBSD 3.0_STABLE (i386 pcc0.9.8) optimisation disabled
- OpenBSD 4.1-current GENERIC#1241 May 17, 2007 (sparc64 gcc3.3.5)
- FreeBSD 6.2-RELEASE (IA64 gcc3.4.6)
- Mac OSX Tiger 10.4.10 Darwin 8.10.0 (macppc gcc4.0.1 Apple build 5363)
- Mac OSX Tiger 10.4.10 (build 8R2232) Darwin 8.10.1 (i386 gcc4.0.1 Apple build 5367)
- – tests by third parties –
- MidnightBSD 0.2-CURRENT (i386 gcc3.4.4 20050518)
- OSF/1 V4.0 1229 (alpha gcc2.8.1)
- – older mksh versions –
- UWIN-NT 2006-02-14 (i386 bcpp BCC32.EXE 5.5.1, ILINK32.EXE 5.00) result doesn’t pass regress
- UWIN-NT 2006-02-14 (i386 dmc DMC.EXE 8.42n, LINK.EXE OPTLINK 7.50B1) with kludges
- UWIN-NT 2006-02-14 (i386 msc CL.EXE 13.00.9466, LINK.EXE 7.00.9466) with kludges
- Solaris 10 Generic_125100-04 (sparc64,V9 sun4u SUNcc5.8 121015-04, ld 5.10-1.482)
- Ångström GNU/Linux spitz 2.6.20.6 PREEMPT (armv5tel glibc2.5 gcc4.1.2) compiled natively, not cross
- Debian GNU/Linux 3.1 sarge 2.6.8-3 (alpha gcc1:3.3.5-13)
- Debian GNU/kFreeBSD 4.0 sid 5.4-1-486 (i386 gcc4.1.2-12)
- 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-5)
- 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-15)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 icc9.1.042)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 icc10.0.023)
- Debian GNU/Linux 4.0 etch 2.6.18-4-k7 (i386 TenDRA-4.1.2)
- Debian GNU/Linux 4.0 etch 2.6.18-4-k7 (i386 tcc0.9.23) didn’t link with libc*.a
- Debian GNU/Linux 4.0 testing 2.6.18-4-686 (i386 gcc4.2.1-3)
- Red Hat Enterprise Linux 5 2.6.18-8.1.6.el5 (IA64 icc9.1.047)
- Oracle Enterprise Linux 4 2.6.9-42.0.0.0.1.ELsmp (amd64 gcc3.4.6)
- mksh R29g
- MirOS #10 RC2 (i386 gcc3.4.6)
- Solaris 8 Generic_117350-41 (sparc,V8+ sun4u gcc3.4.3)
- Debian GNU/Linux 4.0 etch 2.6.18-4-686 (i386 gcc4.1.1-21)
- mksh R29d
- Darwin 8.9.0 Mac OSX 10.4 (powerpc)
- AIX 5.3 ML05 – thanks Gurft
- Solaris 5.10 Generic_118833-36 (sun4u) 32-bit, 64-bit
- mksh R29c
- MirOS #10-beta (i386 gcc3.4.6)
- Solaris 8 (sun4u gcc3.4.3) both without and with -m64
- DragonFly 1.9-dev (i386 gcc3.4.6)
- NetBSD 3.0-stable (i386 gcc3.3.3)
- Cygwin 1.5.24-2 (i386 gcc3.4.4 win2k)
- Interix 3.5 (i386 gcc3.3 win2k)
- OpenBSD 4.0 (sparc64 gcc3.3.5)
- Debian etch (i386, ia64, amd64 gcc4.1.1-21)
- FreeBSD 6.1 (i386, ia64 gcc3.4.4)
- HP-UX 11i B.11.11 (PA-RISC gcc3.4.2) no regression test run
- HP-UX 11i v2 B.11.23 (ia64 gcc3.4.3)
- – tests by third parties –
- Solaris 10 (sun4us gcc4.0.3 "gccfss") 32-bit, 64-bit – thanks Ankon
- mksh R29 – release candidate
- MirOS #7-stable (sparc gcc2.95), #9-current (i386 gcc3.4.6)
- Linux 2.0 (i386 libc5 gcc2.7.2.3), 2.4 (mipsel uClibc gcc3.4.4), 2.6 (i386 glibc gcc4.1.2pre, s390x glibc gcc4.1.2pre)
- Solaris 8 (sun4u gcc3.4.3)
- Mac OSX 10.4 [I think] (macppc gcc4.0.2apple)
- NetBSD 3.0-stable (i386 gcc3.3.3)
- DragonFly 1.9-dev (i386 gcc3.4.6)
- OpenBSD 4.0 (sparc64 gcc3.3.5)
- Cygwin 1.5.19(0.150/4/2) 2006-01-20 13:28 (i386 gcc3.4.4 win2k)
- Interix 3.5 (i386 gcc3.3 win2k)
- mksh-2007-02-18
- MirOS #9uAC (i386, gcc 3.4.6+SSP), as part of base system, as part of installer, run with stand-alone Build.sh
- Debian 4.0-experimental (i386, kfreebsd-amd64, kfreebsd-i386), gcc 4.1.1-21 (4.1.2-prerelease), autobuilder via Debian rules
- Debian 4.0-testing (i386, 2.6.16-2-686, gcc 4.1.1-21), manually via Debian rules)
- Solaris 8 (sun4u), both -m32 and -m64 (gcc 3.4.3) via Build.sh
- FreeWRT GNU/Linux trunk (mipsel, gcc 3.4.4), via ADK
- mksh-current
- OpenSolaris Build 47
- Linux td156 2.6.8-3-mckinley-smp #1 SMP Sat Jul 15 11:48:36 UTC 2006 ia64 GNU/Linux
- mksh R28
- MirOS BSD #9-stable (i386)
- MirOS BSD #7-stable (sparc)
- Solaris 8 (sun4u) SUNW,Ultra-60
- NetBSD 3.0_STABLE (i386)
- DragonFly BSD 1.3-Preview (i386)
- DragonFly BSD 1.7-DEVELOPMENT (i386 SMP)
- Debian GNU/Linux 3.1-testing 2.6.16-2-686 (i386)
- Debian GNU/Linux 3.1-testing 2.6.17-2-vserver-s390x (s390x)
- Debian GNU/Linux 3.1-stable 2.4.27-2-k7 (i386)
- Darwin 8.7.0 Mac OSX 10.4 (powerpc)
- Debian GNU/Linux 3.1-unstable (all architectures except ia64) – debianised
- OpenBSD 3.9 (sparc64) – via contributed port
- Debian GNU/Linux 3.1-stable 2.4.27-2-k7 (i386) – via an experimental pkgsrc® package
- CYGWIN_NT-5.0 1.5.19(0.150/4/2) 2006-01-20 13:28 (i386) – testsuite not run
- Interix SFU 3.5 (Windows® 2000 Pro) SP-8.0.1969.1 (i386) – testsuite not run
- NetBSD 3.0 (mac68k) – tested by Jonathan "ciruZ" Schleifer
- Darwin 8.7.1 Mac OSX 10.4 (i386) – tested by Angelo Laub
- Solaris 8 (sun4m) SUNW,SPARCstation-5 – tested by Angelo Laub
- FreeWRT GNU/Linux SVN 2.4-BRCM (mipsel) – part of FreeWRT: testsuite not run
- FreeBSD (unknown) – part of FreeBSD Ports: not tried
- Gentoo GNU/Linux (i386 powerpc) – part of Portage: not tried
- CRUX GNU/Linux (i386) – via Han Boetes' repository: not tested
- Sourcemage GNU/Linux (amd64) – via test grimoire: not tried
- generic pkgsrc® – not tested; ONLY_FOR_PLATFORMS not honoured
Attention: NetBSD 1.6.1/pmax (for example on a DECstation 5000/260) does not come with a stdbool.h – simply write one yourself (not required for mksh R29 and up):
typedef int bool; #define true 1 #define false 0
This is pretty simple but enough for mksh.
- mksh R28ß
- NetBSD 1.6.1 (pmax)
- mksh R27e
- Ubuntu GNU/Linux (amd64 i386 powerpc): part of "edgy universe"
- mksh R27d
- There is a DragonFly pkgsrc in preparation, I wonder why they haven't been committed yet.
- Has been verified to build on NetBSD/alpha.
- mksh R27c
- Solaris 10: Tonnerre says it passes test suite. His X login manager crashes when using mksh as default shell (also under GNU/Linux for him, can't reproduce), and scp(1) seems to fail.
- An mksh package exists in the Fink package manager for Mac OSX.
- mksh R26c
- Windows® 2000 / Interix (SFU 3.5): works, no testsuite (perl too old); can be used to replace system shell except for its I18N and Win32 features.
- NetBSD® 1.6.1/pmax: I have replaced the standard shell with mksh with good success and only one testsuite failure in heredoc-tmpfile-8. On NetBSD® 1.5/pmax this trick does not work because the system scripts are not compatible with the Korn shell.
- Gentoo GNU/Linux (ppc, x86): an official ebuild exists.
- mksh R25b
- MirOS #7: works well
- GNU/Cygwin: builds, testsuite succeeds, basic usage.
- mksh R25
- NetBSD® 2.0.2/i386: works well
- DragonFly BSD: Portable mksh builds; the test suite succeeds.
- Mac OSX Tiger: The testsuite works, and it can be used to play around. Apple does not install the tools needed for a static build.
- Nexenta OS (i386): part of "elatte" GNU/Solaris
- Ubuntu GNU/Linux (amd64 i386 powerpc): part of "dapper universe"
- mksh R24
- Mac OSX Panther: I don't see a difference to Tiger.
Recent Changes
In mksh R29g we MFCd the following changes:
- Some optimisations from above; no longer execute foreign objects
- Improvements in checking for __attribute__, multi-idstring support, signals, types, arc4random.c; disable -fno-tree-vrp and -fwhole-program --combine; correct large file support (still kludgy but no longer buggy)
Please use mksh R29f because of below modifications:
- Fix detection of function prototypes (data declaractions were ok)
- Fix a regression introduced in R29e regarding the scroll bar
- Recommendation on version numbering changed; suffixes b, c, … match .2, .3, … like alphabetical numbering order
Dedicated to David Ramsey and Coverity, mksh R29e unveils:
- Don't poll in strcasestr(3) if setlocale(3) isn't used
- Remove some redundant or unused functions
- Fix a horizontal scrolling on tabcomplete bug, reported by David Ramsey, thanks a lot!
- Fix the utf8bom-3 regression test on MirBSD-current
- Some workarounds around problems found by Coverity Scan, mostly issues with Scan, but the changes help gcc to optimise better
- Fix a null pointer dereference in error path, mis-use of strchr(3) to search for a NUL byte, and two possible out-of-bounds array accesses, found by Coverity Scan, many thanks!
- Optimise dot.mkshrc further
- Fix a cursor mis-positioning on backspace bug, reported by David Ramsey again, thanks!
- Fix a scrollbar mis-display on delete bug, reported by David Ramsey
- Fix a scrollbar mis-display on insertion bug, discovered while fixing the above bug
- Correct displaying of scrollbar on delete, with help from dramsey
Portability improvements in mksh R29d contain:
- Unbreak testsuite on Mac OSX (whose brain-dead file system does non-standard Unicode decomposing and normalisation on filenames, thus rendering ANOTHER of our tests unusable *sigh*)
- Port to AIX, thanks to Kurt Telep
- Minor fixes for HP-UX, thanks to HP Testdrive Programme
- size optimisation if utf-8 is assumed to be always on
- Do not scan for and use “-fwhole-program --combine” because it's the cause of at least http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=408850 and breakage with FORTIFY_SOURCE on SuSE; thanks to Pascal Bleser (yaloki), Marcus Rückert (darix), Martin Zobel-Helas, Steve Langasek (vorlon) for tracking this bug down in two different places; Closes: Debian #421518
- small manual page fixes
- copy $PATH from Build.sh to test.sh; thanks to a test account on Sun Solaris 11 donated by Julian Wiesener (yofuh) I was able to verify that you want to prefix $PATH with /usr/xpg4/bin because the other tools (/usr/bin, /usr/ccs, et al.) suck major arse…
- Note: the SuSE package in the Buildservice was created by darix (without my knowledge), is maintained by loki now
- Note: the PDF manual page is now PDF 1.3 (Acrobat 4.x) again
Minor bugfixes in mksh R29c – you might want it:
- Regression fix: mksh has some kind of “encoded string” format; use wdcopy() not str_save() to duplicate this; affects formatting of an error message (and below item) only though
- Bugfix: pdksh has an out-of-bounds memory access; the area of code has been touched by OpenBSD developers but the problem not fixed by them; some optimisations turned this (for the error message formatting of the above item) into a memory corruption bug that was only triggering an actual issue on Debian GNU/Linux experimental on IA-64 with some beta version of GNU glibc; add an appropriate bounds check
- Add mirtoconf check for “large file support” needed on some obscure platforms; requested by bsiegert@, idea from GNU autoconf (thanks)
- Add zsh workaround to Build.sh (just to be on the safe side; zsh isn't bourne sh or posix sh compatible, but I didn't find any severe problems with using it to build mksh yet, it's a weird shell though)
- If execve(2) fails with ENOEXEC, try and parse a shebang line ourselves, in case the kernel can do less than we do, unless MKSH_SMALL
- Strip off and ignore an UTF-8 Byte Order Mark (U+FEFF, 0xEF 0xBB 0xBF) at the beginning of input (file, -c option, stdin, interactive, eval) and when processing shebang lines and enable utf8 mode if encountered
- Enhancements to the dot.mkshrc file, whose status (in MirBSD itself) is now upgraded from “sample file for portable mksh to show off to other OSes” to “used as skeleton file in the default installation” – gets us rid of duplicating this stuff in /etc/profile (MirBSD native) a̲n̲d̲ makes sure that users of portable mksh also have the latest goodies
- When doing shebang parsing, accept not only LF and NUL but also CR as markers for end of the (first) line
- If executing fails, tell the user what exactly failed, too
Immediately upgrade to mksh R29b please:
- Bugfix: display UTF-8 control characters (U+0080..U+009F, i.e. everything with a wcwidth(3) of -1) the same as ASCII control characters (U+0001..U+001F), i.e. with a ctrl caret followed by its value XOR U+0040; subsequently treat their width as 2; fix crash (CPU hog in spinning loop) on meta-tab+backspace
- Fix setlocale description in manual page
- in the utf-8 mode, invalid multibytes are now handled more strictly:
- if it's in x_literal() (“quote” / ^V) mode, it's accepted like now
- if it's a mb sequence start, it's rejected with a beep
- if it's a mb continuation, the whole sequence is silently rejected
- remove unused utf_width() macro
- if $CC supports -fstack-protector-all, add it to CFLAGS
- shut up some more gcc 4.1.2 warnings
- if $CC supports -fno-tree-vrp and is subject to the null pointer test optimised away bug, use -fno-tree-vrp to work around it
- in Build.sh, simplify a.out / a.exe (Cygwin) issues
- shrink the manual page to 39 pages sized DIN A4 when built as PS/PDF
- fix a typo in the manual page
Please upgrade to mksh R29 due to the following changes:
- Fix portability of regression tests using fgrep(1), twice
- Fix description of $RANDOM in manual page
- Fix build under OpenSolaris Build 47 (reported in IRC)
- Use easier __RCSID() stuff from MirOS #9-current
- Don't shebang with spaces in test.sh creation
- Remove -fno-strength-reduce from default CFLAGS, the compiler bug was fixed between gcc 2.7.2 and gcc 2.7.2.1…
- Avoid unaligned memory access causing SIGBUS on IA-64 on Debian
- Convert to autoconf-style check for function and header file existence of <sys/param.h>, arc4random(3), arc4random_push(3), setlocale(3) and LC_CTYPE, nl_langinfo(3) and CODESET, getmode(3) and setmode(3), strcasestr(3), and strlcpy(3)
- Add set -o utf8-hack aka mksh -U which changes the Emacs editing mode to an experimental CESU-8 aware multibyte mode (not implemented using wide chars unless internally needed; does not require OS support); check setlocale(LC_CTYPE, "") and nl_langinfo(CODESET) if found to auto-enable utf-8 mode in interactive shells
- Simplify and clean up code; try to remove or replace function calls by smaller equivalents; spot a few non-fatal off-by-one errors
- If Build.sh is called with -DMKSH_SMALL in the CPPFLAGS environment variable, the built-in mknod(8) will not be included, and other functionality and verbose usage messages will be excluded; some macros will be turned into functions to save space and to check if the utf8-hack should be enabled, nl_langinfo(3) is not called. The -T option to mksh(1) and persistent history are not supported.
- Hand-optimise the code to be small, even in the normal build
- Unbreak the -d option to Build.sh
- Check for cc options -Wno-error, -fwhole-program --combine, and (if MKSH_SMALL) -fno-inline and use them if they don't fail
- The autoconf-style (“mirtoconf”) checks have been enhanced, improved and be made more verbose by default
- Rewrite a few functions both to save space and to simplify/unify the code; also spotted a few bugs in existing (inherited) code
- Fix format string mistakes and wrong function and data prototypes
- Correct zero-padding for right-justified strings; add regression test
- EXECSHELL is now ${EXECSHELL:-/bin/sh} again
- Remove duplicate code if feasible; rewrite remaining code to solve all use cases, or use standard library functions such as qsort(3); rework the ctypes and chtypes stuff, get rid of libc/ctype.h
- Change the eaccess() code to not use setreuid(2) and friends, like OpenBSD ksh and apparently pdksh. I'm not too sure about the implications, except that they only affect setuid shell scripts.
- Use setresuid(2) and friends, and setgroups(2) and <grp.h> instead of seteuid(2), setuid(2) etc. on operating systems that support them
- Work around (i.e. remove) all but two -Wcast-qual issues
- Work around a bug in the GNU implementation of the Berkeley mdoc macros which comes with GNU groff (only visible in MirOS with groff -mgdoc, but shows on other operating systems), discovered by crib in IRC
- $RANDOM is always an unsigned 15-bit decimal integer, for all Korn shell derivates; idea from twkm in IRC
- Improve/correct description of typeset command in manpage, and implementation of typeset -p in mksh
- Remove the non-standard emacs-usemeta and vi-show8 shell options, assume the user either has a 7-bit environment, an 8-bit clean terminal, or a UTF-8 environment (preferred), and the dummy sh option
- Build.sh fix for conservative (old) versions of gcc; help Debian
- Compute user-given ulimit value times ulimit unit as an rlim_t value, not as long value; catches some 32 bit overflows on 32 bit platforms due to a missing cast
- Fix some typos in the manual page
- Build.sh add notes for old and non-gcc compilers (TODO)
- Upgrade licence to latest template (revision 1.20)
- Fix reverse logic error in strcasecmp(3) vs strcasestr(3) issue
- Enhance sample ~/.mkshrc
- Prevent segfaults when setlocale(3) or nl_langinfo(3) return NULL
- Use RLIMIT_AS if RLIMIT_VMEM is not found
- Don't expand ~foo/ if MKSH_SMALL, spares getpwnam(3) call
- Fix and autoconfify signal list generation
- Build.sh now uses $TARGET_OS as "uname -s" output for cross builds
- Set flag for regression tests that can't succeed if MKSH_SMALL
- Don't even check for setlocale(3) if MKSH_SMALL, unless overridden by user / build environment
- Scan for C Preprocessor, use $CPP if $CC -E fails
- Fix possible nil pointer dereferences and signal name mismatches
- Scan for __attribute__((...)) and -std=gnu99 (req'd on Solaris 10)
- Correct $LDSTATIC logic, unbreak -d, don't let the user override (or need to) $SRCS, $sigseen
- Simplify TIOCGWINSZ handling, no need to catch SIGWINCH any more; window size changes are processed after input line editing ends (i.e. the lines are entered or ESC # (emacs mode) is pressed) and at startup; ^L (redraw) can't change window size on the fly
- Add -fwrapv to standard CFLAGS, just to be safe, like with when I added -fno-strict-aliasing; this is pending a bug fix in gcc, see PR#30477
- autoconfify compiler flags, c preprocessor
- add option to avoid pulling in getpwnam(3) in !MKSH_SMALL
- scan for certain headers, types; improve portability
- speed up autoconfiguration process in failure case
- finally fix static vs dynamic linking issues
- fix manpage (.Nm macro) glitch with GNU nroff 1.15
- improve auto-detection of which regression tests are valid
- mention failure to revoke(2) is possibly insecure
- if MKSH_SMALL, don't include -T support and don't scan for revoke() function
- new #ifdef MKSH_NEED_MKNOD to embed mknod(8) even if MKSH_SMALL is enabled
- do not scan for revoke() on GNU/Linux since it always fails
- simplify GNU/Linux CPPFLAGS and use them for GNU/HURD and GNU/kFreeBSD (tested on Debian experimental, thanks to the ftbfs.de autobuilder and Michael "azeem" Banck)
- fix the 'bind' (no args) builtin output
- new #ifdef MKSH_ASSUME_UTF8 to not check setlocale() and nl_langinfo(CODESET) if we want to always enable the utf-8 command line editing mode
- tabcomplete a newline to singlequote+newline+singlequote instead of backslash+newline which is eaten; thanks to Thomas E. "TGEN" Spanjaard for noticing
- remove shebang line from check.pl which isn't +x anyway
- fix 'hd' alias in dot.mkshrc example to not run off an ANSI standard 80 column screen; simplify
- integrate MKSH_NEED_MKNOD and MKSH_ASSUME_UTF8 with Build.sh
- Work around Solaris /usr/ucb/tr, Solaris /usr/xpg4/bin/tr, Minix 3 /usr/bin/tr, and SUSv3 deficiencies
- Fix compilation on more platforms (Interix, Cygwin, Linux 2.0 libc5, Debian GNU/kFreeBSD, Debian GNU/HURD, …)
- Use autoconfiguration for persistent history stuff
- Fix the code (add "const" in like 1001 places) to be able to build without -Wno-cast-qual (hope it's safe now)
- Optionally use const-debugging versions of strchr(3), strstr(3), to work around deficiencies in ANSI C
- The above directly led to our own strcasestr(3) implementation for OSes which don't have it
- Optimise dot.mkshrc macros
- Let dot.mkshrc not return failure early
- Remove shadowing warnings for more OSes
- Support old ash(1) versions in Build.sh
- Support use of _NSIG for NSIG
- Optimise ctags(1) generation
Upgrading to mksh R28 with these changes is highly recommended:
- For these who build software as root, the regression testsuite has been adapted to pass when using a priviledgued shell. You have been warned, though. Do not compile software as root.
- Fix some more -Wchar-subscripts on NetBSD®
- Adjust manual page to the fact that mksh can be used as /bin/sh although it's not specifically designed to
- Simplify mdoc/nroff macro load in manual page
- Add sample file: dot.mkshrc
- Correct and enhance book citation list in the manual page
- Bring back the "version" editing command in both emacs and vi modes, at ESC ^V like AT&T ksh93r+
- Fix typo which resulted in the wrong names for signals being printed (error codes were used instead) on GNU/Linux, Solaris and GNU/Cygwin. Ease changing signame/siglist sources.
- Some more code cleanup and redundancy removal
- Merge a few OpenBSD changes, yielding better multiline prompt support and textual improvements in the manual page
- Adjust $PS1 sizing, printing, and redrawal routines for mksh behaviour and single- and multiline prompts
- Unbreak build process on Cygwin, fix manpage generation
- For the AT&T $PS1 hack (second char = CR), do not output the delimiting characters any more, even if they are printable – fixes platforms without non-printable characters (Interix, Cygwin) and prompt size calculation
- Calculate length of prompt in lines and columns-of-last-line instead of using some tricks to skip the beginning of the prompt, resulting in correct redrawing of prompts with ANSI colour codes
- Correct displaying of prompts spanning more than one line and/or with embedded newlines or carriage returns; correct documentation of $PS1 and the redraw editing command
- Change one of the testsuite "expected failure" tests from bug to feature – it might actually be required by make(1)
- Enable to bind key sequences which consist of the usual optional one or two præfices and the control character, as well as an optional trailing tilde (if the trailing character is not a tilde, it's processed as usual, but processing of the editing command is postponed until after the trailing character has been read)
- Bind the NetBSD® wscons (vt220 / wsvt25), GNU screen and XFree86® (xterm-xfree86) "home", "end" and "delete" keys to ^A, ^E and ^D, respectively, except that "delete" does not act as logoff switch
- Correct Test.sh shebang line
- Make sure ^T is bound to 'transpose' as documented (bug spotted by hondza)
- Remove the 'stuff' and 'stuff-reset' editing commands
- Correct the manual page regarding the 'abort' command, its interaction with 'search-history' and how to exit the latter
- Bring back "set -o posix" turning off 'braceexpand'
- Mention IRC channel #mksh/Freenode in manual page
- Merge gensigs.sh into Build.sh, eliminating the need for $SHELL and making it more robust to broken user shells such as zsh, use the mksh just built for Test.sh; simplify CPPFLAGS and reduce size of generated table
- Run the signal name generator only if needed
- Use the -c option to GNU nroff, always
- Make the "last command of a pipeline is executed in a subshell" issue a dependable mksh feature
- Improve regression test comments and a few tests
- If $RANDOM is generated from arc4random(3), display at most 31 bits of it like nbsh(1), instead of only 15 bits.
- Rename the regression test script from Test.sh to test.sh
- Improve Build.sh output regarding other files than the binary
- Mention #ksh/Freenode in the manual page, since its founder (twkm) said it's okay and on-topic as well
- Fix persistent history, add regression test
- Check for arc4random(3) and arc4random_push(3) by using the compiler instead of hardcoding OSes which have and which don't, because that's not always true
- Fix some regression tests (based upon user feedback too)
We recommended mksh R27e to be used:
- Allow Test.sh to be passed parameters (-v)
- Fix all -Wchar-subscripts on Solaris/sparc64 and NetBSD®/alpha and remove -Wno-char-subscripts from Build.sh
- Correct date in version and manual page
What became of mksh R27d in the meanwhile?
- Changes for easier crossbuildability
- Honour $CPPFLAGS in gensigs.sh
- Only source ${ENV:-~/.mkshrc} for interactive (FTALKING) shells
- There's a chance that non-MirOS systems have arc4random_push(3) at some time in the future, so make it configurable.
Featuring mksh R27c with these changes:
- emacs-usemeta now behaves like vi-show8 (be careful with 0x80-0x9F)
- Portability cleanup and speed-up; refine præprocessor defns
- GNU groff compatible manual page
- Fixes for Solaris 10 support
- Add ~/.mkshrc as $ENV feature (see manual page)
- Illustrate interactive shell tricks ($PS1) in manual page
- Enhance testsuite
- Incorporate some more code cleanup by OpenBSD
- Reference the O'Reilly books in the manual page
- R27c: fix packaging errors of previous versions
Changes in the minor version R26c, relative to R26b:
- Code cleanup by OpenBSD
- Documentation enhancements
- Fix gcc4 warnings in portable mksh
Changes in the minor version R26b, relative to R26:
- Makeup changes to copyright file (change comment leader)
- Sync licence with MirOS template (disclaimer changed a little)
- When building, generate a ./Test.sh on the fly which can be used instead of having to copy and paste a long line to run the regression test suite (still no way to run ifs.sh as we cannot distribute it, though).
- Add a few programming tricks to the manual page
- Fix abuse of unquoted characters in the manual page
- (no actual source code changes)
New major version R26 changed this, relative to R25b:
- Change the behaviour of \" in here documents to adhere SUSv3 (inspired by OpenBSD, most code by tg@)
New minor version R25b contains these changes:
- arc4random_push(3) does not exist on older MirOS systems; fixes build on MirOS #7quater
- Add GNU Cygwin to the list of supported platforms
New major version R25 contains these changes:
- Some manual page fixes and updates
- On window resizing, the COLUMNS and LINES variables are updated automatically, not only after the next command (from OpenBSD)
- Fix some redraw problem (from OpenBSD)
- Allow < and > for test and [, not only [[
- If an array index is out of bounds, tell which one (from OpenBSD)
- Add mknod(8) for pipes (user/root) and devices (root only) as a shell builtin – idea and some of the code from OpenBSD
- Improve compatibility with Solaris, GNU/Linux, Darwin, Interix
- Prevent redefinition of __rcsid string on systems without __RCSID macro (found by Han Boetes)
- Remove the need to manually specify -d on some OSes which need it
- Add a compiler flag to reduce some spurious Solaris-only warnings
R24c is another clean-up release, with no change to KSH_VERSION.
- Document stance on quoting policy in here documents
- More fixes for GCC 4 warnings
R24b is a minor clean-up relase, recommended especially on Darwin.
- please GCC 4 with the usual crazy set of warning flags
- remove 'version' editor binding and remap emacs ^V to quote-meta ('literal')
- use open(2) instead of creat(3), from OpenBSD
- fix order of includes
- some code simplification; no explicit LFS needed any more
R24 is an important bug fix release and the new required minimum version to be installed for MirMake. Changes are:
- GNU/Cygwin is now supported but not officially tested
- DragonFly BSD is now supported and officially tested
- FreeBSD should work as a side effect of the above
- On NetBSD, arc4random(3) can now be used if it exists
- no longer look at argv[0] to determine if restricted shell
- changes to $EDITOR and $VISUAL no longer affect the current editing mode
- emacs on, emacs-usemeta off is now the default editing mode
- the special "posix" and "sh" modes are gone
- code, test suites and documentation have been cleaned up a little
- Korn's bizarre /dev/fd hack is now no longer supported
- undo fix for Debian PR #71256 which turned to be bogus and break make(1)
- fix compilation and invocation of test suite with whitespace in the pathnames for real, this time
- the distfile is now signed using gzsig(1)
R23 comes with an overhauled build system providing more flags for easier configuration, a bug-fix if the relative path to $0 contained a space, and does not need h2ph(1) to build some headers any more. Also, the code has cleaned up a bit and some manual page glitches were corrected. Some of these changes originated by Han Boetes, a few came via the OpenBSD project.
R22d is the first version which works if source or build directory contain spaces in the pathname. It also allows building without bothering to pre-format the manual page.
R22c contains some compile time warning fixes on non-MirOS platforms.
R22b contains an important fix regarding the srand(3) initialisation logic and a portability fix for NetBSD.
R22 is the result of three different kinds of work: integrating diffs from Debian's pdksh package, as needed, including fixing bugs and of course testing and fixing docs; fixing the dreaded emacs-mode filename with brackets (hello AONE); much cleanup and polishing. Also, the new codebase has been tested on a fair number of systems now, with more to follow (maybe even new, currently unsupported, platforms).
R20b contains some minor arc4random and build fixes against R20.
R21 has been a three-way integration work from OpenBSD-current's ksh, MirOS-current's ksh and portable mksh R20. This is the first release to come without autoconf'd script; it is much smaller and installs both faster and easier. Several bugs have been fixed, the testsuite has been enhanced and the code was cleaned up largely. pdksh lookalikeness was largely dropped, and support for octal and sedecimal (hexadecadic) numbers via prefixing with 0 or 0x has been added. This is an experimental release; it is not yet supported e.g. by MirMake – make(1) – or other tools but this will follow soon. MirbsdKsh R21 is to be the only shell available on MirOS #9.
R20 integrated an experimental bugfix from millert@openbsd and shuffled some code around. OS/2 support vanished, and the rest of the code shrank and was optimised. This is the first version since v1.11 to work on SFU (Interix) 3.5 as-is. The upgrade to R20 is highly recommended. Note: the mksh R20 distfile has changed from before Dec 14, 16:00.
R19 changes back a bugfix from R18 which caused a regression (from OpenBSD) and changed behaviour to match ksh88 on Solaris (from OpenBSD).
v1.18 (R18) fixes some core dump bugs and is a recommended update.
v1.17 comes out with the final MirOS licence template applied, but not yet OSI approved (it's not our fault though). There are regression fixes and bug fixes; IFS field splitting now works as documented. This version is a major improvement both over v1.16 and OpenBSD /bin/ksh, so please use it and report possible bugs.
v1.16 IS A BETA VERSION, use at your own risk. This version comes with a code cleanup session (for compilation with -Wall -Werror -W -pedantic and in preparation for doing an indent(1) whack over the source; any volunteers?) and some new features (with -T it spawns on a different tty than you're on - cool for single user mode) and code removed (the mailbox checking functionality, since everyone sane uses UW-IMAPD to access his MBX format folder using IMAPS, port 993, even to localhost). The code is also ANSIfied and protoised, in preparation for style(9) aka KNF.
There were no v1.13, v1.14, and v1.15 was never released as portable version. MirbsdKsh version numbers were pretty much RCS IDs at the time of writing this paragraph.
v1.12 fixes the manpages and minor stuff, as well as a signalling bug and the inability to build without gcc installed as gcc. It also adds installation hints for various operating systems.
v1.11 is a minor update to v1.10 with a few build and style fixes only.
