Note: Links marked like this one to the mksh IRC channel connect to external resources.
â Notice: the website will have the latest version of the mksh FAQ online.
This shell is spelt either âmkshâ (with, even at the beginning of a sentence, an initial lowercase letter; this is important) or âMirBSD Korn Shellâ, possibly with âtheâ.
I usually pronounce it as âem-ka-es-haâ, that is, the letters individually in my native German, emphasis on the first syllable, or say âMirBSD Korn Shellâ, although it is manageable, mostly for Slavic speakers, to actually say âmkshâ as if it were a word âș
Oh⊠Iâve run into this one, didnât I? âMirBSDâ is pronounced âMir-Be-Es-Deâ germanically, for anglophones âMir-beasâtieâ is fine.
This translates well into other languages, such as eme-ka-ese-ache in Spanish, although English speakers may still find âMir-beastie korn shellâ more palatable.
mksh is a so-called (Unix) âshellâ or âcommand interpreterâ, similar to COMMAND.COM, CMD.EXE or PowerShell on other operating systems you might know. Basically, it runs in a terminal (âconsoleâ or âDOS boxâ) window, taking user input and running that as commands. Itâs also used to write so-called (shell) âscriptâs, short programs made by putting several of those commands into a âbatch fileâ.
On Android, mksh is used as the system shellâââbasically, the one running commands at system startup, in the background, and on user behalf (but never of its own). Any privilege pop-ups you might be encountering are therefore not caused by mksh but by some other code invoking mksh to do something on its behalf.
Unlike the native command prompt, the current working directory is, for security reasons common on Unix systems which the shell is designed for, not in the search path at all; if you really need this, run the command PATH=.$PATHSEP$PATH or add that to a suitable initialisation file (~/.mkshrc).
There are two different newline modes for mksh-os2: standard (Unix) mode, in which only LF (0A hex) is supported as line separator, and âtextmodeâ, which also accepts ASCII newlines (CR+LF), like most other tools on OS/2, but creating an incompatibility with standard mksh. If you compiled mksh from source, you will get the standard Unix mode unless -T is added during compilation; however, you will most likely have gotten this shell through komhâs port on Hobbes, or from his OS/2 Factory on eComStation Korea, which uses âtextmodeâ, though. Most OS/2 users will want to use âtextmodeâ unless they need absolute compatibility with Unix mksh and other Unix shells and tools.
The Korn Shell (AT&T ksh) was authored by David Korn; two major flavours exist (ksh88 and ksh93), the latter having been maintained until 2012 (last formal release) and 2014 (last beta snapshot, buggy). A ksh86 did exist.
Thereâs now ksh2020, a project having restarted development around November 2017 forking the last ksh93Â v- (beta) snapshot and continuing to develop it, presented at FOSDEM.
AT&T ksh88 is âthe (original) Korn Shellâ. Other implementations, of varying quality (MKS Toolkitâs MKS ksh being named as an example of the lower end, MirBSDâs mksh at the upper end). They are all not âKorn Shellâ or âkshâ. However, mksh got blessed by David Korn, as long as it cannot be confused with the original Korn Shell.
The POSIX shell standard, while lacking most Korn Shell features, was largely based on AT&T ksh88, with some from the Bourne shell.
mksh is the currently active development of what started as the Public Domain Bourne Shell in the mid-1980s with ksh88-compatibl-ish extensions having been added later, making the Public Domain Korn Shell (pdksh), which, while never officially blessed, was the only way for most to get a Korn Shell-like command interpreter for AT&Tâs was proprietary, closed-source code for a very long time. pdkshâs development ended in 1999, with some projects like Debian and NetBSDÂź creating small bug fixes (which often introduced new bugs) as part of maintenance. Around 2003, OpenBSD started cleaning up their shipped version of pdksh, removing old and compatibility code and modernising it. In 2002, development of what is now mksh started as the system shell of MirBSD, which took over almost all of OpenBSDâs cleanup, adding compatibility to other operating systems back on top of it, and after 2004, independent, massive development of bugfixes including a complete reorganisation of the way the parser works, and of new features both independent and compatible with other shells (ksh93, GNU bash, zsh, BSD csh) started and was followed by working with the group behind POSIX to fix issues both in the standard and in mksh. mksh became the system shell in several other operating systems and Linux distributions and Android and thus is likely the Korn shell, if not Unix shell, flavour with the largest user base. It has replaced pdksh in all contemporary systems except QNX, NetBSDÂź and OpenBSD (who continue to maintain their variant on âlow flameâ).
dtksh is the âDesktop Korn Shellâ, a build of AT&T ksh93 with some additional built-in utilities for graphics programming (windows, menu bars, dialogue boxes, etc.) utilising Motif bindings.
MKS ksh is a proprietary reimplemention aiming for, but not quite getting close to, ksh88 compatibility.
SKsh is an AmigaOS-specific Korn Shell-lookalike by Steve Koren.
The Homepage of the #ksh channel on IRC contains more information about the Korn Shell in general and its flavours.
Export a few environment variables, namely CC (the C compiler), CPPFLAGS (all C prĂŠprocessor definitions), CFLAGS (only compiler flags, no -Dfoo or anything!), LDFLAGS (for anything to pass to the C compiler while link