Jump to content

Almquist shell

From Niidae Wiki
Revision as of 18:13, 24 April 2025 by imported>Rodw (Disambiguating links to Bash (link changed to Bash (Unix shell)) using DisamAssist.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description Template:Infobox software Almquist shell (also known as A Shell, ash and sh) is a lightweight Unix shell originally written by Kenneth Almquist in the late 1980s. Initially a clone of the System V.4 variant of the Bourne shell, it replaced the original Bourne shell in the BSD versions of Unix released in the early 1990s.

History

[edit]

ash was first released via a posting to the Template:Mono Usenet news group, approved and moderated by Rich Salz on 30 May 1989. It was described as "a reimplementation of the System V shell [with] most features of that shell, plus some additions".<ref>Template:Cite web</ref>

Fast, small, and virtually compatibleTemplate:Citation needed with the POSIX standard's specification of the Unix shell, ash did not provide line editing or command history mechanisms, because Almquist felt that such functionality should be moved into the terminal driver. However, modern variants support it.

The following is extracted from the ash package information from Slackware v14:

Template:Blockquote

Myriad forks have been produced from the original ash release.<ref name=vars>Template:Cite web</ref> These derivatives of ash are installed as the default shell (/bin/sh) on FreeBSD, NetBSD, DragonFly BSD, MINIX, and in some Linux distributions. MINIX 3.2 used the original ash version, whose test feature differed from POSIX.<ref>Template:Cite web</ref> That version of the shell was replaced in MINIX 3.3. Android used ash until Android 4.0, at which point it switched to mksh.<ref>Template:Cite web</ref>

Template:Infobox software In 1997 Herbert Xu ported ash from NetBSD to Debian Linux. In September 2002, with release 0.4.1, this port was renamed to Dash (Debian Almquist shell). Xu's main priorities are POSIX conformance and slim implementation.<ref name=vars/>

Like its predecessor, Dash implements support for neither internationalization and localization nor multi-byte character encoding (both required in POSIX).Template:Citation needed Line editing and history support based on GNU Readline is optional (Template:Code).

Adoption in Debian and Ubuntu

[edit]

Template:AnchorBecause of its slimness, Ubuntu decided to adopt Dash as the default /bin/sh<ref name="Debian">Template:Cite web</ref><ref name="Ubuntu">Template:Cite web</ref> in October 2006 with version 6.10. The reason for using Dash is faster shell script execution,<ref>Template:Cite book</ref> especially during startup of the operating system, compared to previous versions of Debian and Ubuntu that used Bash for this purpose, although Bash is still the default login shell for interactive use.<ref>Template:Cite book</ref>

A result of the shift is that many shell scripts were found making use of Bash-specific functionalities ("bashisms") without properly declaring it in the shebang line.<ref>Template:Cite web</ref><ref>Template:Cite web</ref> The problem was first spotted in Ubuntu and the maintainers decided to make all the scripts comply with the POSIX standard. The changes were later upstreamed to Debian, which eventually adopted Dash as its default Template:Code too in Debian 6 (Squeeze), released in February 2011.<ref name="Debian"/> As a result, Debian policy was amended to allow script developers to assume a largely POSIX-compliant shell, save for the extensions merged into Dash for convenience (Template:Code, Template:Code, Template:Code).<ref name=deb>Template:Cite web</ref><ref>Template:Man</ref> A similar transition has happened in Slackware Linux, although its version of Template:Code is only partially based on Dash.<ref name=vars/>

Embedded Linux

[edit]

Ash (mainly the Dash fork) is also fairly popular in embedded Linux systems. Dash version 0.3.8-5 was incorporated into BusyBox, the catch-all executable often employed in this area. Modern BusyBox versions support additional Bash features which are enabled in modern distributions like Alpine Linux, Tiny Core Linux and Linux-based router firmware such as OpenWrt, Tomato and DD-WRT.

See also

[edit]

References

[edit]

Template:Reflist

[edit]

Template:Unix shells