Bourne | Ash |  #!  | find | ARG_MAX | Shells | portability | permissions | UUOC | ancient | - | ../Various | HOME
"$@" | echo/printf | set -e | test | tty defs | tty chars | $() vs ) | IFS | using siginfo | nanosleep | line charset | locale


Ash (Almquist Shell) Variants

2010-08-23 (see recent changes)

After I had repeatedly wondered how all those "ash" variants might be related, I had a look at the variants I know.
Source is available for all variants, except for BSD/OS. Thanks to TUHS for archiving the traditional BSDs and 386BSD,
to Kirk McKusick for his CSRG archive, and to Peter Seebach for allowing me to learn all BSD/OS variants.

This page documents relationships. For the variants without changelogs (the traditional BSDs, 386BSD, BSD/OS and Minix) this page aims at being a complete log
(with emphasis on the source). For the other variants this was certainly not the goal and just some arbitrarily chosen changes or bugfixes are listed.

Content:

· 1.) Original release '89
· 2.) Traditional BSDs: 4.3BSD-Net/2 '91, 4.4BSD-Alpha '92, 4.4BSD '93, 4.4BSD-Lite '94, 4.4BSD-Lite2 '95
· 3.) 386BSD '92-'93
· 4.) BSD/OS (BSDi) '91-'03
· 5.) NetBSD '93-
· 6.) FreeBSD '96-
· 7.) early port from NetBSD to Linux '93   (and early Slackware, Debian)
· 8.) dash '97-    (and later Slackware)
· 9.) Slackware variant of dash '06-
· 10.) BusyBox '01-
· 11.) Minix '01-

Here's an illustration of the family tree (click for an increased size).


1.) Original release ('89) - sh(1)

It was written by Kenneth Almquist as replacement to the traditional "System V Release 4" Bourne shell
due to the license war between AT&T and Berkeley. Berkeley distributed it first with "BSD 4.3-Net/2".
The source was posted to comp.sources.unix, "A reimplementation of the System V shell", on 30-05-1989.
Shortly after, Kenneth published a job control patch to fix the problem that more than 4 jobs were not handled properly.

Differences between the ash family and the SVR4 shell:

Common to the original Almquist shell and the SVR4 shell, but changed with later ash variants:

Common to ash variants and the SVR4 shell only, in contrast to other bourne compatible shells:

Details which are only found in early ash variants:

[1] In fact, no ash variant needs "case x in (x)" because the parser is robust about case constructs in $(...) command substitution.
However, several other shells are not robust and they have to work around it this way; so this is a script portability issue.
It was, sooner or later, fixed in most implementations: BSD/OS 3.0 (06/'96), dash-0.3.5-4 (08/'99) (and thus Busybox and Slackware 8.1 ff.), FreeBSD 4.8/5.1 (10/'02), NetBSD 4.0 (06/'06).

Details which are found in early and in some later ash variants:

2.) Traditional BSDs ('91-'95)

  4.3BSD-Net/2 (06/'91) - sh(1)

  4.4BSD-Alpha (06/'92) - starts aiming at POSIX.2 - sh(1)

  4.4BSD (06/'93) - sh(1)

   Apparently, the 386BSD patchkit 2.4 (local copy) went into this release or vice versa:

    and:

  4.4BSD-Lite (06/'94) - sh(1)

  4.4BSD-Lite2 (06/'95) - sh(1)

This release has synched with NetBSD at about 05/'95.

3.) 386BSD ('92-'93) - sh(1)

The 386BSD distribution was derived from 4.3BSD-Net/2 and aimed at maintaining a runnable system,
that is, completing Net2 with the pieces which had to be removed after the license war.

See the 386BSD archive on TUHS.

4.) (BSDi) BSD/OS ('92-'03)

This is a commercial BSD branch from the vendor BSDi.
And the vendor F5 for example uses a BSD/OS 4.1 as core for its product BIG-IP 4.2.

   Thus, there remain for example the following differences to modern variants:

5.) NetBSD ('93-current)

Initially derived from 386BSD-0.1, soon synchronized with 4.4BSD-Lite.

Some changes:

CVS-Web on netbsd.org.

6.) FreeBSD ('94-current)

Derived from 4.4BSD-Lite, -Lite2 and NetBSD 1.2/1.3

Some changes:

CVS-Web on freebsd.org.

7.) Early port of a NetBSD variant to Linux ('93)

Contributions by e.g. Sunando Sen, Arjan de Vet, Florian La Roche.
This earlier port is not related to the later dash from Herbert Xu.

Thus this variant is still very close to 4.3BSD-Net/2 and even the original version.

Several distributions came with this variant:

ash-linux-0.2 tarball on metalab.unc.edu.

8.) dash ('97-current)

This started as a Linux port for Debian, from Herbert Xu, derived from NetBSD.
And Debian stable release 2.0 ("Hamm", 03/'99) then replaced the early Linux port ash-0.2 with this variant.

Two high priorities of this project are restricting to POSIX conformance and slim implementation.

The Ubuntu distribution switched to dash (wiki.ubuntu.com) as system shell (/bin/sh) with release 6.10 (october '06).
The Debian distribution wants to switch to dash (wiki.debian.org) as system shell according to the Squeeze release goals.
(It was a release goal for Lenny already, but the move was postponed, then).

The dash manual documents the command line history and editing capabilities (gained with 4.4BSD-Alpha). These features are disabled at compile time, though.
You can enable them by recompiling: have the "BSD editline and history library" available (package libedit-dev on Debian) and remove -DSMALL from src/Makefile.

Some changes:

Herbert Xu's dash, Debian package. For the changelogs, see ./Changelog (0.5.5.1 snapshot) and the older ./debian/changelog (snapshot) in the distribution.

9.) Slackware variant of debian ash ('06-current)

Slackware 2.1 ('10/'94) had switched to the abovementioned early ash-linux-0.2 port.

Slackware 8.1 (09/'06) switched to debian ash-0.4.0 and a collection of 21 debian patches, (with the debian specific stuff taken out)
With later releases, these patches were not modified anymore (until Slackware 13.1, at the time of this writing).

Some other smaller distributions, emphasizing on a slim shell, also use the Slackware shell variant.

Via slackware.org mirrors to slackware-current/source/ap/ash/

10.) BusyBox ('01-current)

The BusyBox distribution is aiming for small implementations.

Home is www.busybox.net, source online.

11.) Minix ('01-'06/'06-current)


Sven Mascheck, <http://www.in-ulm.de/~mascheck/various/ash/>