LKSH(1) General Commands Manual LKSH(1)

lkshLegacy Korn shell built on mksh

lksh [-+abCefhiklmnprUuvXx] [-+o opt] [-c string | -sfile [args ...]]

lksh is a command interpreter intended exclusively for running legacy shell scripts. It is built on mksh; refer to its manual page for details on the scripting language. It is recommended to port scripts to mksh instead of relying on legacy or objectionable POSIX-mandated behaviour, since the MirBSD Korn Shell scripting language is much more consistent.

Do not use lksh as an interactive or login shell; use mksh instead.

Note that it's strongly recommended to invoke lksh with -o posix to fully enjoy better compatibility to the POSIX standard (which is probably why you use lksh over mksh in the first place); -o sh (possibly additionally to the above) may be needed for some legacy scripts.

lksh currently has the following differences from mksh:

mksh(1)

http://www.mirbsd.org/mksh.htm

http://www.mirbsd.org/ksh-chan.htm

To use lksh as /bin/sh, compilation to enable set -o posix by default if called as sh (adding -DMKSH_BINSHPOSIX to CPPFLAGS) is highly recommended for better standards compliance.

For better compatibility with legacy scripts, such as many Debian maintainer scripts, Upstart and SYSV init scripts, and other unfixed scripts, also adding the -DMKSH_BINSHREDUCED compile-time option to enable set -o posix -o sh when the shell is run as sh, as well as integrating the optional disrecommended printf(1) builtin, might be necessary.

lksh tries to make a cross between a legacy bourne/posix compatibl-ish shell and a legacy pdksh-alike but “legacy” is not exactly specified.

Talk to the MirBSD development team and users using the mailing list at <miros-mksh@mirbsd.org> or in the #!/bin/mksh IRC channel; mind the infos from http://www.mirbsd.org/mksh-faq.htm#contact for either. Consider migrating your legacy scripts to work with mksh instead of requiring lksh.

January 5, 2024 MirBSD