Jump to content

Almquist shell

From Wikipedia, the free encyclopedia

Template:Short description {{#invoke:Infobox|infobox}}Template:Template other {{#invoke:Check for unknown parameters|check|unknown=Template:Main other|preview=Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y| AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo class | logo size | logo title | logo upright | logo_alt | logo_caption | logo_class | logo_size | logo_title | logo_upright | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | qid | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot class | screenshot size | screenshot title | screenshot upright | screenshot_alt | screenshot_class | screenshot_size | screenshot_upright | service_name | size | standard | title | ver layout | website }}Template:Main other{{#invoke:Check for conflicting parameters|check | template = Template:Infobox software | cat = Template:Main other | logo size; logo_size | logo class; logo_class | logo alt; logo_alt | logo title; logo_title | logo caption; logo_caption | screenshot size; screenshot_size | screenshot upright; screenshot_upright | screenshot class; screenshot_class | screenshot alt; screenshot_alt | screenshot title; screenshot title | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | programming language; programming_language | operating system; operating_system }} 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

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".[1]

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:

<templatestyles src="Template:Blockquote/styles.css" />

ash (Kenneth Almquist's ash shell)

A lightweight (92K) Bourne compatible shell. Great for machines with low memory, but does not provide all the extras of shells like bash, tcsh, and zsh. Runs most shell scripts compatible with the Bourne shell. Note that under Linux, most scripts seem to use at least some bash-specific syntax. The Slackware setup scripts are a notable exception, since ash is the shell used on the install disks. NetBSD uses ash as its /bin/sh.

{{#if:|

|}}{{#if:|

}}{{#invoke:Check for unknown parameters|check|unknown=Template:Main other|preview=Page using Template:Blockquote with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | 3 | 4 | 5 | author | by | char | character | cite | class | content | multiline | personquoted | publication | quote | quotesource | quotetext | sign | source | style | text | title | ts }}

Screenshot of Chimera Linux with FreeBSD ash, showing the system information and some Unix commands
Chimera Linux with FreeBSD sh

Myriad forks have been produced from the original ash release.[2] These derivatives of ash are installed as the default shell (/bin/sh) on FreeBSD[3], NetBSD[4], DragonFly BSD[5][6], MINIX[2], and in some Linux distributions, such as Alpine Linux[7]. MINIX 3.2 used the original ash version, whose test feature differed from POSIX.[8] 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.[9] Chimera Linux uses FreeBSD's version of the ash as its default, which is quite unique in the Linux realm.[10]

Dash

{{#invoke:Infobox|infobox}}Template:Template other {{#invoke:Check for unknown parameters|check|unknown=Template:Main other|preview=Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y| AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo class | logo size | logo title | logo upright | logo_alt | logo_caption | logo_class | logo_size | logo_title | logo_upright | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | qid | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot class | screenshot size | screenshot title | screenshot upright | screenshot_alt | screenshot_class | screenshot_size | screenshot_upright | service_name | size | standard | title | ver layout | website }}Template:Main other{{#invoke:Check for conflicting parameters|check | template = Template:Infobox software | cat = Template:Main other | logo size; logo_size | logo class; logo_class | logo alt; logo_alt | logo title; logo_title | logo caption; logo_caption | screenshot size; screenshot_size | screenshot upright; screenshot_upright | screenshot class; screenshot_class | screenshot alt; screenshot_alt | screenshot title; screenshot title | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | programming language; programming_language | operating system; operating_system }} 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.[2]

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 libedit is optional (<syntaxhighlight lang="text" class="" style="" inline="1">--with-libedit</syntaxhighlight>).

Adoption in Debian and Ubuntu

Template:AnchorBecause of its slimness, Ubuntu decided to adopt Dash as the default /bin/sh[11][12] in October 2006 with version 6.10. The reason for using Dash is faster shell script execution,[13] 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.[14]

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.[15][16] 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 <syntaxhighlight lang="text" class="" style="" inline="1">/bin/sh</syntaxhighlight> too in Debian 6 (Squeeze), released in February 2011.[11] 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 (<syntaxhighlight lang="text" class="" style="" inline="1">local</syntaxhighlight>, <syntaxhighlight lang="text" class="" style="" inline="1">echo -n</syntaxhighlight>, <syntaxhighlight lang="text" class="" style="" inline="1">test -a / -o</syntaxhighlight>).[17][18] A similar transition has happened in Slackware Linux, although its version of <syntaxhighlight lang="text" class="" style="" inline="1">ash</syntaxhighlight> is only partially based on Dash.[2]

Embedded Linux

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

References

Template:Reflist

Template:Unix shells

  1. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  2. ↑ 2.0 2.1 2.2 2.3 {{#invoke:citation/CS1|citation |CitationClass=web }}
  3. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  4. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  5. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  6. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  7. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  8. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  9. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  10. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  11. ↑ 11.0 11.1 {{#invoke:citation/CS1|citation |CitationClass=web }}
  12. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  13. ↑ Template:Cite book
  14. ↑ Template:Cite book
  15. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  16. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  17. ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
  18. ↑ Template:Man