Bourne | Ash |  #!  | find | ARG_MAX | Shells | whatshell | 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

2006-02-14 .. 2021-02-13 (see recent changes)

After I had repeatedly wondered how all those "ash" variants might be related, and had found hardly any information, I had a closer 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.
And for the variants without changelogs (the traditional BSDs, 386BSD, BSD/OS and Minix) this page aims at being a complete log concerning source code changes.
But for the other, later variants this was certainly not the goal and just a few, arbitrarily chosen changes or bugfixes are listed.
Why no commented diffs? I won't manage to do that work. And if you're interested on this level, then you are looking at the source already and these comments are a good start.

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.) Android variant (derived from NetBSD) '05-
· 11.) Cygwin variants of ash '98-
· 12.) BusyBox '01-
· 13.) Minix '01-

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.

First, a few summaries for orientation, what it's about with these almquist shells.

Differences between the ash family and the SVR4 shell:

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 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:

A detail which is found in ash, in the SVR4 shell, and in most bourne compatible shells, but usually not documented

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 patchlevel 0.2.3, soon synchronized with 4.4BSD-Lite.

Some changes:

NetBSD 0.8 and 0.9 (by Jason Steven aka Neozeed).
CVS-Web on netbsd.org (since ~1.0).

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.

As this variant is closeley related to 4.3BSD-Net/2 with the 386BSD patches, it still shows the following effects:

This variant is usually known as ash-0.2 and several distributions came with it:

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 switched to dash with the release 6.0/"Squeeze" (release goals, Debian shells).
(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) then switched to a variant similar to dash 0.3.7-14.

It is based on a NetBSD ash tarball named 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).
The debian changelog which is contained stops at 0.3.7-14, a fix from 0.3.7-11 is in
(preserve previous exit status upon entering a function), and a fix from 0.3.7-15 is not in
(unknown escape codes are printed literally by echo).

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.) Android variant of NetBSD ash ('05-current)

Originally, the system shell on Android (/system/bin/sh) was an ash variant.
The Android core consists of a Linux kernel and, for license reasons, NetBSD utilities instead of GNU.

The initial release (android-1.0) in the public part of the Android core source repository dates from Oct 21 2007.
It's a checkout from the NetBSD repository, some time after 13th of june 2005 which is the latest rcs time stamp in the code.
NetBSD was going to be released as 3.0 soon, in December 2005.

The NetBSD ash source was checked out only once, early in the alpha phase of the Android project,
and was just minimally modified so that it compiled on Android. From then on it was changed almost only for compiling reasons.

android.googlesource.com, the public part in the Android Open-Source Project (AOSP).
Core source: /platform/system/core

11.) Cygwin variants of ash ('98-current)

http://cygwin.com/ (aka http://sources.redhat.com/cygwin/),
Repository of older Cygwin releases,
ChangeLog.RedHat from ash-20040127-3

12.) BusyBox ('01-current)

The BusyBox distribution is aiming for small implementations.
Apart from that, emphasis is both on standards compliance and on user convenience, where bash plays a role.
Although further features were added, there's no reference documentation at the time of this writing (05/'11).
VMWare ESX (6.7.0) has it as system shell.

Home is www.busybox.net, source online (with log)

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


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