Rc
Encyclopedia
rc is the command line interpreter for Version 10 Unix
and Plan 9 from Bell Labs
operating system
s. 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 called Duff's device
.
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 ALGOL
-like, as the original Bourne shell
uses, except that it uses a construct if not 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 "$@".
is expressed in rc as
Because if and if not are two different statements, they must be grouped in order to be used in certain situations.
Rc also supports more dynamic piping:
Version 10 Unix
Tenth Edition Unix, also known as Version 10 Unix or V10, was the last version of the Research Unix operating system developed and used internally at Bell Labs. "Released" in 1989, it was the successor of V9...
and Plan 9 from Bell Labs
Plan 9 from Bell Labs
Plan 9 from Bell Labs is a distributed operating system. It was developed primarily for research purposes as the successor to Unix by the Computing Sciences Research Center at Bell Labs between the mid-1980s and 2002...
operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
s. It resembles the Bourne shell
Bourne shell
The Bourne shell, or sh, was the default Unix shell of Unix Version 7 and most Unix-like systems continue to have /bin/sh - which will be the Bourne shell, or a symbolic link or hard link to a compatible shell - even when more modern shells are used by most users.Developed by Stephen Bourne at AT&T...
, but its syntax is somewhat simpler. It was created by Tom Duff
Tom Duff
Thomas Douglas Selkirk Duff is a computer programmer. He was born in Toronto, Ontario, Canada and grew up in Toronto and Leaside. In 1974 he graduated from the University of Waterloo with a B.Math and, two years later, got an M.Sc...
, who is better known for an unusual C programming language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
construct called Duff's device
Duff's device
In computer science, Duff's device is an optimized implementation of a serial copy that uses a technique widely applied in assembly language for loop unwinding. Its discovery is credited to Tom Duff in November of 1983, who at the time was working for Lucasfilm. It is perhaps the most dramatic...
.
A port of the original rc to Unix is part of Plan 9 from User Space
Plan 9 from User Space
Plan 9 from User Space is a port of many Plan 9 from Bell Labs libraries and applications to Unix-like operating systems...
. A rewrite of rc for Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
operating systems by Byron Rakitzis
Byron Rakitzis
- Biography :He studied in Princeton University, obtaining the title of Bachelor of Arts in Physics in 1990.The same year he won the IOCCC contest, in the Best Utility category....
is also available but includes some incompatible changes.
Rc uses C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
-like control structures instead of ALGOL
ALGOL
ALGOL is a family of imperative computer programming languages originally developed in the mid 1950s which greatly influenced many other languages and became the de facto way algorithms were described in textbooks and academic works for almost the next 30 years...
-like, as the original Bourne shell
Bourne shell
The Bourne shell, or sh, was the default Unix shell of Unix Version 7 and most Unix-like systems continue to have /bin/sh - which will be the Bourne shell, or a symbolic link or hard link to a compatible shell - even when more modern shells are used by most users.Developed by Stephen Bourne at AT&T...
uses, except that it uses a construct if not 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 "$@".
Examples
For example, the Bourne shell scriptis expressed in rc as
Because if and if not are two different statements, they must be grouped in order to be used in certain situations.
Rc also supports more dynamic piping:
External links
- "Rc - The Plan 9 Shell" - by Tom Duff - Plan 9 manual page.
- Plan 9 from User Space - Includes rc and other Plan 9 tools for Linux, Mac OS X and other Unix-like systems.
- Byron Rakitzis' rewrite for Unix
- werc - A web document management system implemented completely in the rc shell.
- ircrc - An IRC client, using /net directly, implemented completely in one rc file.
- contrib - A Plan 9 package manager made with rc.