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
YashYet another shell
okshPortable OpenBSD ks
esExtensible shell with higher-order functio
duneA shell by the beach
coshConcatenative command-line she
gshPOSIX-compatible generative shell
arshStatically typed scripting language with shell-like features
Sushi shellBash clone shell implemented in Rust
fortshShell written in Fortran
hshSlightly different take on your shell
ReShellModern shell
rashRudimentary shell
DaxCustom Unix shell implementation

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted