Rc (Unix shell)

rc
Paradigmimperative, pipeline
Designed byTom Duff
DeveloperBell Labs
First appeared1989; 35 years ago (1989)
Typing disciplineweak
OSCross-platform (Version 10 Unix, Plan 9, Plan 9 from User Space)
Websitedoc.cat-v.org/plan_9/4th_edition/papers/rc
Dialects
Byron's rc
Influenced by
Bourne shell
Influenced
es, the Inferno shell
Preview warning: Page using Template:Infobox programming language with unknown parameter "source_model"
An rc session

rc (for "run commands") is the command line interpreter for Version 10 Unix and Plan 9 from Bell Labs operating systems. It resembles the Bourne shell, but its syntax is somewhat simpler. It was created by Tom Duff, who is better known for an unusual C programming language construct ("Duff's device").[1]

A port of the original rc to Unix is part of Plan 9 from User Space. A rewrite of rc for Unix-like operating systems by Byron Rakitzis is also available but includes some incompatible changes.

Rc uses C-like control structures instead of the original Bourne shell's ALGOL-like structures, except that it uses an if not construct instead of else, and has a Bourne-like for loop to iterate over lists. In rc, all variables are lists of strings, which eliminates the need for constructs like "$@". Variables are not re-split when expanded. The language is described in Duff's paper.[1]

  1. ^ a b Duff, Tom (1990). ""Rc — The Plan 9 Shell"". cat-v. Retrieved 2024-01-26.