Images of shells by the sea

loksh – Linux port of the Korn shell

loksh is a Linux port of the Korn shell supplied by OpenBSD. It follows the OpenBSD source closely and deliberately keeps platform-specific changes to a minimum rather than adding its own extensions.

The shell is intended for both interactive use and shell scripting. Its command language is a superset of the traditional Bourne shell language, with Korn shell facilities for arithmetic, arrays, job control, command-line editing and reusable functions. loksh targets Linux exclusively, which helps keep the port compact and makes it suitable for lightweight or resource-constrained systems.

This is public domain software.

Key Features

  • Linux port of OpenBSD’s Korn shell.
  • Closely tracks the upstream OpenBSD implementation.
  • Keeps downstream modifications and additional features to a minimum.
  • Suitable for interactive use and shell scripts.
  • Mostly compatible with POSIX shell and AT&T Korn shell behaviour.
  • Run commands, functions, builtins and external executables.
  • Variables, positional parameters and indexed arrays.
  • Parameter, command, arithmetic and tilde substitution.
  • Integer arithmetic expressions using (( expression )).
  • Conditional expressions using [[ expression ]].
  • Filename globbing and pattern matching.
  • Brace expansion and tilde expansion.
  • Input and output redirection, including here documents.
  • Construct pipelines and optionally enable pipefail behaviour.
  • Conditional execution using && and ||.
  • Asynchronous commands and background pipelines.
  • Co-process support using the |& operator.
  • If, case, for, select, while and until compound commands.
  • User-defined shell functions.
  • Interactive job control with jobs, fg, bg, wait and kill builtins.
  • Command history and the fc history editor.
  • Emacs, gmacs and Vi command-line editing modes.
  • Aliases and command hashing.
  • Signal and exit handling through shell traps.
  • Login-shell processing through /etc/profile and the user’s .profile.
  • Interactive startup configuration through the ENV parameter.
  • Restricted-shell mode prevents directory changes, path modifications and unsafe redirections.
  • Privileged-shell mode uses a separate system profile.
  • Can be invoked as ksh, sh or restricted rksh.
  • Small implementation without an external plugin or scripting framework.

Website: github.com/dimkr/loksh
Support:
Developer: dimkr and OpenBSD developers
License: Public Domain

loksh is written in C. Learn C with our recommended free books and free tutorials.


Related Software

Shells
zshAdvanced and programmable command interpreter
NushellAdopts the Unix philosophy of shells where pipes connect command together
fishSmart and user-friendly command line shell
XonshPython-powered, cross-platform shell language and command prompt
bashsh-compatible command language interpreter
MurexIntuitive, typed and content aware shell
PowerShellCross-platform automation and configuration framework
ElvshExpressive programming language and a versatile interactive shell
OilsBilled as an upgrade to bash. Written in Python.
DASHPOSIX-compliant implementation of sh that aims to be as small as possible
shShell parser, formatter, and interpreter
tcshC shell with file name completion and command line editing
mkshMirBSD Korn shell
ksh Unix shell which was developed by David Korn at Bell Labs
brushPOSIX- and bash compatible shell
RashLanguage, library, and shell REPL for Racket.
ionModern system shell that features a simple, yet powerful, syntax
CicadaBash-like command environment with scripting and job control
YashYet another shell
okshPortable OpenBSD ks
esExtensible shell with higher-order functio
duneA shell by the beach
coshConcatenative command-line she
MarcelModern command environment combining Python with Unix pipelines
HilbishHighly extensible command environment configured with Lua
gshPOSIX-compatible generative shell
arshStatically typed scripting language with shell-like features
Sushi shellBash clone shell implemented in Rust
lokshLinux port of OpenBSD's Korn-compatible command interpreter
fortshShell written in Fortran
hshSlightly different take on your shell
ReShellModern shell
rashRudimentary shell
DaxCustom Unix shell implementation
cjshPOSIX-oriented command environment with modern interactive features

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted