Kalpana Kalpana (Editor)

Rc

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Paradigm
  
imperative, pipeline

Developer
  
Bell Labs

Designed by
  
Tom Duff

Typing discipline
  
weak

Rc

First appeared
  
1989; 28 years ago (1989)

OS
  
Cross-platform (Version 10 Unix, Plan 9, Plan 9 from User Space)

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").

Contents

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, 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 "$@".

es

es (for "extensible shell") is an Open source, command line interpreter developed by Rakitzis and Paul Haahr, that uses a scripting language syntactically similar to the rc shell. It was originally based on code from Byron Rakitzis's clone of rc for Unix

Extensible shell is intended to provide a fully functional programming language as a Unix shell. The bulk of es development occurred in the early 1990s, after the shell was introduced at the Winter 1993 USENIX conference in San Diego, Official releases appear to have ceased after 0.9-beta-1 in 1997, and standard es lacks features as compared to more popular shells, such as zsh and bash.

Examples

For example, the Bourne shell script

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:

a |[2] b # pipe only standard error of a to b — in Bourne shell as a 3>&2 2>&1 >&3 | b a <>b # opens b as a's standard input and standard output a <{b} <{c} # becomes a {standard output of b} {standard output of c}

References

Rc Wikipedia