ash
Provide a lightweight shell interpreter
SYNOPSIS
ash [-acCefhiklmnoprstuvxD] [-o option] [file [arg...]]
PARAMETERS
-a
Automatically export all variables
-c
Read commands from the next argument string
-C
Disable clobbering (prevent >! redirection)
-Dname=value
Define dynamic loader macro
-e
Exit on error (non-zero command status)
-f
Disable filename expansion (globbing)
-h
Hash commands for faster lookup (implies -i)
-i
Force interactive mode
-k
Read functions from environment
-l
Invoke as login shell
-m
Enable job control (monitor mode)
-n
No-execute mode; syntax check only
-o option
Set shell option (e.g., emacs, vi)
-p
Privileged mode; ignore profile
-r
Restricted shell mode
-s
Read commands from stdin
-t
Exit after one command
-u
Treat unset variables as error
-v
Verbose; echo input lines
-x
Trace; print commands before execution
--help
Display usage information
--version
Show version details
-+abc
Disable options abc
DESCRIPTION
Ash (Almquist Shell) is a compact, efficient command interpreter for Unix-like systems, designed as a minimalist clone of the Bourne shell (sh). Created by Kenneth Almquist, it prioritizes a small binary size and low memory usage, making it perfect for embedded devices, rescue disks, and minimal Linux distributions like Alpine Linux and BusyBox.
Ash adheres closely to POSIX standards for shell scripting, supporting variables, loops, conditionals, functions, pipes, redirections, and job control in full implementations. It operates in interactive or script modes, sourcing profiles like .profile and .ashrc. Built-ins handle common tasks (e.g., cd, echo, test), reducing external dependencies.
Unlike feature-rich shells like Bash, Ash omits arrays, advanced pattern matching, and GUI integrations, focusing on core functionality for speed (up to 10x faster startup). Variants exist in NetBSD, FreeBSD, and Linux; BusyBox ash bundles it with other utils. It's often symlinked as /bin/sh for POSIX compliance.
Ideal for resource-constrained environments, Ash powers init systems and boot scripts where size matters most.
CAVEATS
Feature set is minimal; lacks Bash extensions like arrays or brace expansion. POSIX compliance varies by implementation (e.g., BusyBox subset). No UTF-8 support in older versions; job control may be limited.
STARTUP FILES
Loads /etc/profile, ~/.profile, ~/.ashrc (interactive). Login shells source /etc/ash.login.
BUILT-INS
Core: alias, bg, break, cd, command, echo, eval, exec, exit, export, fg, jobs, kill, local, pwd, read, set, shift, test, times, trap, umask, unalias, unset, wait.
HISTORY
Developed in 1989 by Kenneth Almquist for 386BSD as a public-domain sh replacement. Enhanced for NetBSD (1990s), merged into FreeBSD. Linux ports via BusyBox (1990s) and standalone in Alpine. Evolved with POSIX.1 updates; modern versions in OpenBSD/NetBSD maintain active development.


