ArticleslgStudy

computer science

Almquist shell

Almquist shell is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Almquist shell rather than just read about it. In short: 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.

Almquist shell — main illustration
Almquist shell — illustration

Key takeaways

  • Almquist shell belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Almquist shell to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Almquist shell from memory before moving on to harder problems.

Reference excerpt

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 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". Fast, small, and virtually compatible 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:

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.

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

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 nor multi-byte character encoding (both required in POSIX). Line editing and history support based on libedit is optional (--with-libedit).

Adoption in Debian and Ubuntu Because of its slimness, Ubuntu 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 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 scripts 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 standard. The changes were later upstreamed to Debian, which eventually adopted Dash as its default /bin/sh 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 (local, echo -n, test -a / -o). A similar transition has happened in Slackware Linux, although its version of ash is only partially based on Dash.

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 Comparison of command shells

References

External links Official website dash(1) – Linux User Manual – User Commands from Manned.org dash(1) – Debian General Commands Manual sh(1) – FreeBSD General Commands Manual sh(1) – NetBSD General Commands Manual

Illustrations

Almquist shell illustration
Almquist shell: Chimera Linux with FreeBSD sh
Chimera Linux with FreeBSD sh
Almquist shell illustration

Worked examples

Example 1 — a first encounter with Almquist shell

Start with the simplest possible case. Write down what Almquist shell claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Almquist shell before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Almquist shell ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Almquist shell

In research
Almquist shell appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Almquist shell in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Almquist shell is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1989 software, Cross-platform software, Scripting languages, so understanding it makes those chapters shorter.
In everyday life
Look for Almquist shell outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Almquist shell” →

How to study Almquist shell in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Almquist shell means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Almquist shell out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Almquist shell in simple terms?

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.

Why does Almquist shell matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Almquist shell?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Almquist shell.

Tags

  • 1989 software
  • Cross-platform software
  • Scripting languages
  • Text-oriented programming languages
  • Unix shells

Keep exploring