Almquist shell (also known as A Shell, ash and sh) is a lightweight
Unix shell
A Unix shell is a Command-line_interface#Command-line_interpreter, command-line interpreter or shell (computing), shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command languag ...
originally written by
Kenneth Almquist in the late 1980s. Initially a clone of the
System V.4 variant of the
Bourne shell
The Bourne shell (sh) is a shell command-line interpreter for computer operating systems. It first appeared on Version 7 Unix, as its default shell. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic lin ...
, it replaced the original Bourne shell in the
BSD
The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
versions of Unix released in the early 1990s.
History
ash was first released via a posting to the
Usenet
Usenet (), a portmanteau of User's Network, is a worldwide distributed discussion system available on computers. It was developed from the general-purpose UUCP, Unix-to-Unix Copy (UUCP) dial-up network architecture. Tom Truscott and Jim Elli ...
news group, approved and moderated by
Rich Salz on 30 May 1989. It was described as "a reimplementation of the System V shell
ithmost features of that shell, plus some additions".
Fast, small, and virtually compatible with the
POSIX
The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
standard's specification of the Unix shell, ash did not provide
line editing or
command history
Command history is a feature in many operating system shells, computer algebra programs, and other software that allows the user to recall, edit and rerun previous commands.
Command line history was added to Unix in Bill Joy's C shell of 1978; ...
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
Slackware is a Linux distribution created by Patrick Volkerding in 1993. Originally based on Softlanding Linux System (SLS), Slackware has been the basis for many other Linux distributions, most notably the first versions of SUSE Linux distr ...
v14:
Myriad forks have been produced from the original ash release.
These derivatives of ash are installed as the default shell (
/bin/sh
) on
FreeBSD
FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
,
NetBSD
NetBSD is a free and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was fork (software development), forked. It continues to ...
,
DragonFly BSD
DragonFly BSD is a free and open-source Unix-like operating system forked from FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and FreeBSD developer between 1994 and 2003, began working on DragonFly BSD in ...
,
MINIX, and in some
Linux distribution
A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s. MINIX 3.2 used the original ash version, whose
test
Test(s), testing, or TEST may refer to:
* Test (assessment), an educational assessment intended to measure the respondents' knowledge or other abilities
Arts and entertainment
* ''Test'' (2013 film), an American film
* ''Test'' (2014 film) ...
feature differed from POSIX. 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.
Dash
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.
[
Like its predecessor, Dash implements support for neither ]internationalization and localization
In computing, internationalization and localization (American English, American) or internationalisation and localisation (British English, British), often abbreviated i18n and l10n respectively, are means of adapting to different languages, regi ...
nor multi-byte character encoding (both required in POSIX). Line editing and history support based on GNU Readline
GNU Readline is a software library that provides in-line editing and history capabilities for interactive programs with a command-line interface, such as GNU bash, Bash. It is currently maintained by Chet Ramey as part of the GNU Project.
It allo ...
is optional ().
Adoption in Debian and Ubuntu
Because of its slimness, Ubuntu
Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
decided to adopt Dash as the default /bin/sh
in October 2006 with version 6.10. The reason for using Dash is faster shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be command languages. Typical operations performed by shell scripts include file manipu ...
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.
A result of the shift is that many shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be command languages. Typical operations performed by shell scripts include file manipu ...
s were found making use of Bash-specific functionalities ("bashisms") without properly declaring it in the shebang line. The problem was first spotted in Ubuntu and the maintainers decided to make all the scripts comply with the POSIX
The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
standard. The changes were later upstreamed to Debian, which eventually adopted Dash as its default too in Debian 6 (Squeeze), released in February 2011. 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 (, , ). A similar transition has happened in Slackware Linux, although its version of is only partially based on Dash.[
]
Embedded Linux
Ash (mainly the Dash fork) is also fairly popular in embedded Linux
The Linux, Linux Operating system is prevalent in embedded systems. As of 2024, developer surveys and industry reports find that Embedded Linux is used in 44%-46% of embedded systems. Due to its Linux range of use, versatility, its large community ...
systems. Dash version 0.3.8-5 was incorporated into BusyBox
BusyBox is a software suite that provides several List of Unix commands, Unix utilities in a single executable file. It runs in a variety of POSIX environments such as Linux, Android (operating system), Android, and FreeBSD, although many of the ...
, 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
OpenWrt (from ''open wireless router'') is an open-source project for embedded operating systems based on Linux kernel, Linux, primarily used on Embedded system, embedded devices to Router (computing), route network traffic. The main components ...
, Tomato
The tomato (, ), ''Solanum lycopersicum'', is a plant whose fruit is an edible Berry (botany), berry that is eaten as a vegetable. The tomato is a member of the nightshade family that includes tobacco, potato, and chili peppers. It originate ...
and DD-WRT.
See also
* Comparison of command shells
References
External links
*
*
*
*
*
{{Unix shells
1989 software
Cross-platform software
Scripting languages
Text-oriented programming languages
Unix shells