EnglishFrenchSpanish

OnWorks favicon

lksh - Online in the Cloud

Run lksh in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command lksh that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


lksh — Legacy Korn shell built on mksh

SYNOPSIS


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

DESCRIPTION


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 idiotic POSIX-mandated
behaviour, since the MirBSD Korn Shell scripting language is much more consistent.

Note that it's strongly recommended to invoke lksh with at least the -o posix option, if not
both that and -o sh, to fully enjoy better compatibility to the POSIX standard (which is
probably why you use lksh over mksh in the first place) or legacy scripts, respectively.

LEGACY MODE


lksh currently has the following differences from mksh:

· There is no explicit support for interactive use, nor any command line editing or
history code. Hence, lksh is not suitable as a user's login shell, either; use mksh
instead.

· The KSH_VERSION string identifies lksh as “LEGACY KSH” instead of “MIRBSD KSH”. Note
that the rest of the version string is identical between the two shell flavours, and the
behaviour and differences can change between versions; see the accompanying manual page
mksh(1) for the versions this document applies to.

· lksh uses POSIX arithmetics, which has quite a few implications: The data type for
arithmetics is the host ISO C long data type. Signed integer wraparound is Undefined
Behaviour; this means that...

$ echo $((2147483647 + 1))

... is permitted to, e.g. delete all files on your system (the figure differs for
non-32-bit systems, the rule doesn't). The sign of the result of a modulo operation
with at least one negative operand is unspecified. Shift operations on negative numbers
are unspecified. Division of the largest negative number by -1 is Undefined Behaviour.
The compiler is permitted to delete all data and crash the system if Undefined Behaviour
occurs (see above for an example).

· lksh only offers the traditional ten file descriptors to scripts.

· The rotation arithmetic operators are not available.

· The shift arithmetic operators take all bits of the second operand into account; if they
exceed permitted precision, the result is unspecified.

· The GNU bash extension &> to redirect stdout and stderr in one go is not parsed.

· The mksh command line option -T is not available.

· Unless set -o posix is active, lksh always uses traditional mode for constructs like:

$ set -- $(getopt ab:c "$@")
$ echo $?

POSIX mandates this to show 0, but traditional mode passes through the errorlevel from
the getopt(1) command.

· Unlike AT&T UNIX ksh, mksh in -o posix or -o sh mode and lksh do not keep file
descriptors > 2 private from sub-processes.

· Functions defined with the function reserved word share the shell options (set -o)
instead of locally scoping them.

Use lksh online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    PyQt
    PyQt
    PyQt is the Python bindings for
    Digia's Qt cross-platform
    application development framework. It
    supports Python v2 and v3 and Qt v4 and
    Qt v5. PyQt is avail...
    Download PyQt
  • 2
    Sardi
    Sardi
    Sardi is a complete restyling and
    optimisation of svg code. 6 choices for
    your applications and 10 kind of folders
    to use in your file manager. The sardi
    icons...
    Download Sardi
  • 3
    LMMS Digital Audio Workstation
    LMMS Digital Audio Workstation
    LMMS is a free cross-platform software
    which allows you to produce music with
    your computer. If you like this project
    consider getting involved in the project
    h...
    Download LMMS Digital Audio Workstation
  • 4
    FreeRTOS Real Time Kernel (RTOS)
    FreeRTOS Real Time Kernel (RTOS)
    FreeRTOS is a market-leading real-time
    operating system (RTOS) for
    microcontrollers and small
    microprocessors. Distributed freely
    under the MIT open source lice...
    Download FreeRTOS Real Time Kernel (RTOS)
  • 5
    Avogadro
    Avogadro
    Avogadro is an advanced molecular
    editor designed for cross-platform use
    in computational chemistry, molecular
    modeling, bioinformatics, materials
    science and ...
    Download Avogadro
  • 6
    XMLTV
    XMLTV
    XMLTV is a set of programs to process
    TV (tvguide) listings and help manage
    your TV viewing, storing listings in an
    XML-based format. There are utilities to
    do...
    Download XMLTV
  • More »

Linux commands

Ad