Almquist Shell: Difference between revisions
(Give a brief description. List the three major variants.) |
No edit summary |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{implementation|UNIX Shell}} |
{{implementation|UNIX Shell}} |
||
'''Almquist Shell''' is a minimal implementation of |
The '''Almquist Shell''', a.k.a. <tt>ash</tt>, is a minimal implementation of an almost-[[POSIX]] shell, and also a replacement for the [[compatible with::Bourne Shell]]. Ash has more features than the original Bourne Shell, but fewer features than most other shells; for example, it lacks arrays. For the most part, it only implements POSIX features, but it does have a few traditional [[BSD]] add-ons, such as <code>local</code> variables in functions. Ash is the default shell, <code>/bin/sh</code>, of some systems. |
||
The Almquist Shell does not have any of the internationalization/localization or multi-byte character encoding support required by the POSIX standard, so it is not technically a POSIX-compliant shell. Nonetheless, since it lacks most non-POSIX features, it is helpful in validating that <tt>#!/bin/sh</tt> scripts are not dependent upon such features. In general, if a script works with Almquist Shell, it will probably also work with other popular Bourne-compatible shells, such as the [[Bourne Again SHell]] and [[Z Shell]]. It may not work with the [[Korn Shell]], which uses <tt>typeset</tt> instead of <tt>local</tt>; unfortunately, while bash and zsh treat those commands as synonyms, ash in turn lacks <tt>typeset</tt>. |
|||
Almquist Shell filled the need for a free shell to replace Bourne Shell. Kenneth Almquist posted [http://groups.google.com/group/comp.sources.unix/msg/2774e7653a8e6274 the first version of Ash] to Usenet group comp.sources.unix at 30 May 1989. It was a clone of SVR3 Bourne Shell. [[BSD]] used Ash for <code>/bin/sh</code>, added features from POSIX, and put a Berkeley copyright on this shell. |
Almquist Shell filled the need for a free shell to replace Bourne Shell. Kenneth Almquist posted [http://groups.google.com/group/comp.sources.unix/msg/2774e7653a8e6274 the first version of Ash] to Usenet group comp.sources.unix at 30 May 1989. It was a clone of SVR3 Bourne Shell. [[BSD]] used Ash for <code>/bin/sh</code>, added features from POSIX, and put a Berkeley copyright on this shell. |
||
Line 7: | Line 9: | ||
Ash has three major variants: |
Ash has three major variants: |
||
* [[Debian Almquist Shell]] (Dash) |
* [[Debian Almquist Shell]] (Dash), which adds support for <tt>echo -n</tt> and <tt>test -a</tt>/<tt>-o</tt> |
||
* [http://svnweb.freebsd.org/base/head/bin/sh/ FreeBSD /bin/sh] |
* [http://svnweb.freebsd.org/base/head/bin/sh/ FreeBSD /bin/sh] |
||
* [http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/sh/?only_with_tag=MAIN NetBSD /bin/sh] |
* [http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/sh/?only_with_tag=MAIN NetBSD /bin/sh] |
||
All three variants have similar features. Dash can run on GNU/Linux. |
All three variants have similar features. Dash can run on GNU/Linux. |
||
Ash is also the shell provided by [[BusyBox]]. |
|||
== See also == |
== See also == |
||
* [[wp:Almquist shell]], Wikipedia's article |
* [[wp:Almquist shell|Almquist shell]], Wikipedia's article |
||
* [http://www.in-ulm.de/~mascheck/various/ash/ Ash (Almquist Shell) Variants], a history of many Ash versions and their features |
* [http://www.in-ulm.de/~mascheck/various/ash/ Ash (Almquist Shell) Variants], a history of many Ash versions and their features |
Latest revision as of 20:22, 20 September 2022
The Almquist Shell, a.k.a. ash, is a minimal implementation of an almost-POSIX shell, and also a replacement for the Bourne Shell. Ash has more features than the original Bourne Shell, but fewer features than most other shells; for example, it lacks arrays. For the most part, it only implements POSIX features, but it does have a few traditional BSD add-ons, such as local
variables in functions. Ash is the default shell, /bin/sh
, of some systems.
The Almquist Shell does not have any of the internationalization/localization or multi-byte character encoding support required by the POSIX standard, so it is not technically a POSIX-compliant shell. Nonetheless, since it lacks most non-POSIX features, it is helpful in validating that #!/bin/sh scripts are not dependent upon such features. In general, if a script works with Almquist Shell, it will probably also work with other popular Bourne-compatible shells, such as the Bourne Again SHell and Z Shell. It may not work with the Korn Shell, which uses typeset instead of local; unfortunately, while bash and zsh treat those commands as synonyms, ash in turn lacks typeset.
Almquist Shell filled the need for a free shell to replace Bourne Shell. Kenneth Almquist posted the first version of Ash to Usenet group comp.sources.unix at 30 May 1989. It was a clone of SVR3 Bourne Shell. BSD used Ash for /bin/sh
, added features from POSIX, and put a Berkeley copyright on this shell.
Almquist variants
Ash has three major variants:
- Debian Almquist Shell (Dash), which adds support for echo -n and test -a/-o
- FreeBSD /bin/sh
- NetBSD /bin/sh
All three variants have similar features. Dash can run on GNU/Linux.
Ash is also the shell provided by BusyBox.
See also
- Almquist shell, Wikipedia's article
- Ash (Almquist Shell) Variants, a history of many Ash versions and their features