Amiga Shellscript
The script language of AmigaDOS — inherited wholesale from Cambridge's TRIPOS in 1985, driven by EXECUTE and the dot directives, and still gaining features in AmigaOS 3.2 and AROS today.
Created by Martin Richards' TRIPOS command language, ported to the Motorola 68000 by Tim King at MetaComCo and shipped as AmigaDOS by Commodore-Amiga
Amiga Shellscript is the script language of AmigaDOS: the command language you type at an AmigaShell prompt, saved to a file and run with EXECUTE or by name. It is one of the very few 1980s home-computer shell languages that was not designed for its machine at all. It was lifted, almost verbatim, from TRIPOS — a portable research operating system written in BCPL at the University of Cambridge — and dropped into the Amiga in 1985 because Commodore’s own operating system project had run out of time. Forty-one years later, both of its surviving implementations are still being modified.
History and origins
TRIPOS (“Trivial Portable Operating System”, or, to Cambridge students, “Terribly Reliable, Incredibly Portable Operating System”) was begun in 1976 at the University of Cambridge Computer Laboratory under Martin Richards — the author of BCPL — and first appeared in January 1978 on a PDP-11. Work on a Motorola 68000 version started in 1981 at the University of Bath, and MetaComCo, a British 680x0 tools house, acquired the rights to it. Tim King had written that 68000 port and subsequently joined MetaComCo, which acquired the rights to the 68000 version and continued its development.
Meanwhile, Commodore’s in-house Amiga operating system, CAOS, was badly behind schedule. In March 1985 Commodore chose TRIPOS as the basis of the Amiga’s disk operating system, and MetaComCo won the contract precisely because TRIPOS gave a running head start on an impossible timescale. King got it onto prototype Amiga hardware and married the BCPL-based DOS layer to Carl Sassenrath’s Exec kernel and to Intuition. The Amiga 1000 was introduced on 23 July 1985.
How wholesale the transplant was is easy to see in the documentation. The DOS API, the command-line interface and its commands, the executable (“hunk”) format and the original file system were all essentially identical to TRIPOS, and the first AmigaDOS manual was close to the TRIPOS manual with the name substituted. TRIPOS’s command-file command was called C; on the Amiga it was renamed EXECUTE, and that rename is most of the difference between the two languages.
Design philosophy
The language has no design philosophy of its own, and that is its defining trait. It is a command-sequence facility: a file of lines that AmigaDOS feeds to the CLI “one at a time, just as though you had typed them at the keyboard,” with a preprocessing pass bolted on the front for parameter substitution. There are no functions, no data structures, no arithmetic in the grammar, and no expressions — EVAL exists because the language itself cannot add two numbers.
What it does have is a strikingly early and unusual take on script arguments. Substitution is not positional $1/$2 interpolation but a template:
.KEY name,greeting
.BRA {
.KET }
ECHO "{greeting$Hello}, {name$World}!"
A .KEY line declares the parameter names; <NAME> in the body is replaced by the value the caller supplied, and <NAME$DEFAULT> falls back to a default if the caller left it unset. (The example above has moved the brackets to { and } with .BRA and .KET.) Because the default separator is $ and the brackets are < and > — which collide with I/O redirection — the language lets you move its own syntax out of the way with .BRA, .KET, .DOLLAR and even .DOT, which changes the character that introduces directives. (BRA and KET are almost certainly borrowed from the bra–ket of Dirac notation.) Substitution only happens at all if the file’s first line begins with a dot command; otherwise AmigaDOS assumes there is nothing to scan and skips the preprocessing pass entirely.
The other quirk is control flow. Conditionals are commands, not syntax:
IF EXISTS Work/Prog
TYPE Work/Prog
ELSE
ECHO "It's not here"
ENDIF
IF tests the previous command’s return code (WARN, ERROR, FAIL — thresholds that FAILAT controls), string equality with EQ, or file existence with EXISTS, and NOT inverts any of them. Branching is SKIP to a LAB. Until the 1.3 release, SKIP could only jump forward, which meant the language had conditionals, subroutine-less error handling, and no loops whatsoever.
Key features
| Feature | Mechanism |
|---|---|
| Run a script | EXECUTE script args, or set the s protection bit and type its name |
| Parameters | .KEY template with <KEYWORD$DEFAULT> substitution |
| Syntax escape hatches | .BRA, .KET, .DOLLAR, .DOT |
| Defaults and comments | .DEF keyword value; a line of . followed by a space |
| Conditionals | IF / ELSE / ENDIF, nestable, with NOT, WARN, ERROR, FAIL, EQ, EXISTS |
| Branching and loops | SKIP label forward; SKIP label BACK from 1.3 onward |
| Failure policy | FAILAT <n>, QUIT <rc>, WHY for the last error |
| Variables | SETENV/GETENV (global, files in ENV:); SET/GET/UNSET (shell-local) by 3.1 |
| Arithmetic | EVAL — + - * /, mod, shifts, and, or, xor, eqv, not, with decimal/hex/octal input |
| User interaction | ASK (sets WARN on yes), REQUESTCHOICE and REQUESTFILE for GUI dialogs |
| Speed | RESIDENT keeps EXECUTE and other pure commands in RAM instead of reloading them per invocation |
Two things make the ordinary scripts pleasant to read. Commands advertise a ReadArgs template — Copy ? prints a template along the lines of FROM/M, TO/A, ALL/S, QUIET/S, the exact keywords varying by release — so argument handling is consistent system-wide and self-documenting. And AmigaDOS devices are just names, so a script can redirect to SPEAK: and have its output spoken, or (once AmiTCP arrived) to TCP:Site/Port and have it sent over the network.
Evolution
The language arrived finished and then changed in two bursts.
The first was the V1.3 Enhancer (manual copyright 1987; Workbench 1.3 shipped in 1988), which is where Amiga scripting became usable. The SHELL brought line editing, command history and ALIAS. A new s protection bit meant a script no longer needed the EXECUTE prefix — the Shell recognises the bit and runs the file as a script. SKIP ... BACK made loops possible for the first time (you can skip back as far as the last EXECUTE statement). EVAL added arithmetic, SETENV/GETENV added variables, RESIDENT addressed the cost of reloading EXECUTE from floppy on every script, and ICONX let a script live behind a Workbench icon. The 1.3 C: directory held sixty-four commands.
The second burst was AmigaOS 2.0 (1990, with the Amiga 3000), which rewrote AmigaDOS in C and, more importantly for scripters, integrated ARexx. From that point the Amiga had a proper scripting language with variables, functions and inter-process messaging, and the shell language settled into the role it kept: glue, boot-time configuration, and installation. AmigaOS 3.1 (1994) finished the vocabulary with shell-local variables and Intuition requesters; Haage & Partner’s 3.5 (1999) and 3.9 (2000) improved the Shell further.
Then, remarkably, a third burst thirty-six years after the first. Hyperion Entertainment’s AmigaOS 3.2 (14 May 2021) gave the language configurable TAB autocompletion, shell error redirection, HISTORY and EXECUTE as internal Shell commands, a debug variable that echoes executed commands to the serial port, and — genuinely new syntax — the && and || operators for conditional chaining. AmigaOS 3.2.3, released on 2 April 2025, is the current release for 68000-family Amigas.
Current relevance
The language is historical in the sense that nothing new is built on it, and thoroughly alive in the sense that all of its implementations are maintained. AmigaOS 3.2.x is a commercially sold, actively patched operating system for hardware that first shipped in 1985. AmigaOS 4.1 continues the line on PowerPC, where AmigaDOS finally abandoned its BCPL legacy entirely. MorphOS carries the same command set. AROS reimplements the shell in C from scratch, and its source tree shows commits on 13 and 14 September 2026 tightening the handling of .key numeric templates, .def defaults and the .pushis/.popis directives — a 2026 bug-fix to a command-file mechanism inherited from TRIPOS.
Anyone running an Amiga in emulation — WinUAE, FS-UAE, Amiberry — meets the language immediately, because the machine cannot boot without it: the first program that runs on a configured Amiga is a shell script.
Why it matters
Amiga Shellscript is a case study in how operating-system decisions calcify. A command language written for BCPL research machines in 1970s Cambridge became, by way of a rescue contract signed in March 1985, the thing millions of Amiga users typed at and the thing every Amiga executed at power-on. Its oddities — the .BRA/.KET escape hatches, the template-based arguments, the forward-only SKIP, the conditionals that are commands rather than syntax — are not Amiga design choices at all; they are TRIPOS fossils, preserved because backward compatibility mattered more than tidiness.
It also shows the limits of the “shell as programming language” idea. Commodore shipped a LISP-like Installer in 1992 to replace hand-written installation scripts, which were widely held to be too dangerous in this language, and bundled ARexx in 1990 for everything the shell could not express. The script language survived anyway, because the jobs it is actually good at — assign a name, copy a file, ask a question, branch on a return code, do it at boot — are jobs it has done reliably for four decades.
Timeline
Notable Uses & Legacy
S:Startup-Sequence and S:User-Startup
Every Amiga boots by executing a shell script. Startup-Sequence allocates disk buffers, makes the ASSIGNs, loads Preferences and starts Workbench; because editing it can render a system unbootable, the documentation steers users to a separate User-Startup script for their own ASSIGNs, resident commands and auto-started programs
IconX - scripts as Workbench icons
ICONX, added in the 1.3 Enhancer, runs an AmigaDOS script from a double-clicked project icon: it changes directory to the script's own drawer, opens an I/O window sized by the icon's WINDOW tool type, and honours a DELAY tool type so the output stays readable. It is how shell scripts reached users who never opened a Shell
Software installation before Installer
Through the 1.x and early 2.x era, commercial Amiga software was installed by shipping an EXECUTE script on the distribution floppy that created drawers, copied files and edited the user's startup scripts. Commodore introduced the LISP-like Installer with AmigaOS 2.1 in 1992, a move generally attributed to the damage ad-hoc install scripts could do to users' systems
AmiTCP/IP network bring-up
AmiTCP/IP, the TCP/IP stack that put Amigas on the early-1990s internet, is configured by editing AmigaDOS scripts: users set their IP address and netmask in AmiTCP:bin/startnet, which starts the stack, waits on its ARexx-supplied WaitForPort for initialisation to finish, then configures interfaces and routes
AROS and MorphOS shells
The language outlived its vendor. AROS reimplements the shell from scratch in C - dot directives, EXECUTE semantics, IconX, Protect, Eval and RequestChoice included - and MorphOS carries the same command set forward, so AmigaDOS scripts written in the 1980s still run on modern hardware and emulators