Description #
Mksh is a portable and enhanced version of the Korn shell (ksh), designed to be lightweight while offering advanced scripting features and compatibility with POSIX and Korn shell standards.
History #
Mksh originated from the public domain Korn shell (pdksh) and has been actively maintained by the MirBSD project since the early 2000s, focusing on portability and security.
Hello World Code #
echo "Hello, World!"
How to Run #
Option 1: Online
Try mksh Online (via ShellCheck)
Option 2: Local
Install mksh on Unix-like systems:
sudo apt-get install mksh
mksh
Run script with:
mksh script.sh
Key Concepts #
- POSIX-compliant shell with Korn shell features
- Portable across Unix-like systems
- Lightweight and efficient
- Compatible with ksh88 and ksh93 standards
- Supports advanced scripting constructs
- Secure and maintained actively
- Command-line editing and history support
- Supports shell functions and arrays
- Used in embedded and desktop environments
- Derived from pdksh and enhanced for modern use
Try It Online #
Fun Facts #
- Mksh is the default shell on NetBSD and some BSD variants.
- It is often used in embedded systems due to its small footprint.
- Mksh development focuses heavily on portability and bug fixes.
- It supports many Korn shell scripting idioms popular in legacy scripts.
- The MirBSD project also maintains other security-focused Unix tools.
Resources #
- Mksh GitHub
- MirBSD Project: https://www.mirbsd.org/ (not available)
- POSIX Shell Guide