Supriya Ghosh (Editor)

Almquist shell

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
Kenneth Almquist

Written in
  
C

Development status
  
Active

Initial release
  
May 30, 1989; 27 years ago (1989-05-30)

Operating system
  
Various Unix-like operating systems (BSD, MINIX, Linux, Android)

Available in
  
English, multilingual (gettext)

The 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.

Contents

History, Versions and Impact

ash was first released via a posting to the comp.sources.unix 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".

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

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 and Ubuntu uses ash as its /bin/sh.

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

Derivative versions of ash are installed as the default shell (/bin/sh) on FreeBSD, NetBSD, DragonFly BSD, MINIX, and Android, and in some Linux distributions.

dash: Ubuntu, Debian and POSIX compliance of Linux distributions

In 1997 Herbert Xu ported the 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. Because of these two priorities it became very influential in the Linux world.

Slimness

Because of its slimness, Ubuntu decided to adopt the dash as the default /bin/sh in 2006. The reason for using dash is faster shell script execution, 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. Dash became the default /bin/sh in Ubuntu starting with the 6.10 release in October 2006. Dash replaced ash and became the default /bin/sh in Debian 6 (Squeeze).

Dash implements neither support for Internationalization and localization nor support for multi-byte character encoding.

POSIX compliance

During the transition by Ubuntu, numerous scripts making use of Bash-specific functionality (but not declaring it) were discovered. The elements understood only by bash were called bashisms. Instead of stopping the process of migration to dash, they decided to make all the scripts POSIX compliant. These altered scripts went upstream and, after a while, Debian also decided to adopt the dash as its default `/bin/sh`. The dash shell thus forced first Ubuntu and later on Debian to make their shell scripts POSIX compliant. As these scripts went even further upstream, the POSIX compliance spread to other (non-Debian-based) distributions, such as Arch and Manjaro.

Embedded Linux

Ash is also fairly popular in embedded Linux systems; its code was incorporated into the BusyBox catch-all executable often employed in this area, and is used in distributions like DSLinux, Alpine Linux, Tiny Core Linux and Linux-based router firmware such as OpenWrt, Tomato and DD-WRT.

References

Almquist shell Wikipedia


Similar Topics