Rc (Unix Shell)
   HOME

TheInfoList



OR:

rc (for "
run commands RUNCOM is a Compatible Time Sharing System, CTSS Macro (computer science), macro command (script) processor. History Louis Pouzin created RUNCOM for CTSS circa 1963. He released a paper in 1965 describing a design for the Multics shell which in ...
") is the
command-line interpreter A command-line interface (CLI) is a means of interacting with software via commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternativ ...
for Version 10 Unix and
Plan 9 from Bell Labs Plan 9 from Bell Labs is a distributed operating system which originated from the Computing Science Research Center (CSRC) at Bell Labs in the mid-1980s and built on UNIX concepts first developed there in the late 1960s. Since 2000, Plan 9 has ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s. It resembles the
Bourne shell The Bourne shell (sh) is a shell command-line interpreter for computer operating systems. It first appeared on Version 7 Unix, as its default shell. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic lin ...
, but its syntax is somewhat simpler. It was created by Tom Duff, who is better known for an unusual
C programming language C (''pronounced'' '' – like the letter c'') is a general-purpose programming language. It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of ...
construct (" 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 A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
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 ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
-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.


Influences


es

''es'' (for "extensible shell") is an
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
,
command line interpreter A command-line interface (CLI) is a means of interacting with software via commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternativ ...
developed by Rakitzis and Paul Haahr that uses a
scripting language In computing, a script is a relatively short and simple set of instructions that typically automation, automate an otherwise manual process. The act of writing a script is called scripting. A scripting language or script language is a programming ...
syntax influenced by 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 A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
as a
Unix shell A Unix shell is a Command-line_interface#Command-line_interpreter, command-line interpreter or shell (computing), shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command languag ...
. It does so by introducing "program fragments" in braces as a new datatype, lexical scoping via let, and some more minor improvements. The bulk of es development occurred in the early 1990s, after the shell was introduced at the Winter 1993
USENIX USENIX is an American 501(c)(3) nonprofit membership organization based in Berkeley, California and founded in 1975 that supports advanced computing systems, operating system (OS), and computer networking research. It organizes several confe ...
conference in
San Diego San Diego ( , ) is a city on the Pacific coast of Southern California, adjacent to the Mexico–United States border. With a population of over 1.4 million, it is the List of United States cities by population, eighth-most populous city in t ...
. Official releases appear to have ceased after 0.9-beta-1 in 1997, and es lacks features present in more popular shells, such as zsh and bash. A
public domain The public domain (PD) consists of all the creative work to which no Exclusive exclusive intellectual property rights apply. Those rights may have expired, been forfeited, expressly Waiver, waived, or may be inapplicable. Because no one holds ...
fork of is active .


Examples

The Bourne shell script: if "$1" = "hello" then echo hello, world else case "$2" in 1) echo $# 'hey' "jude's"$3;; 2) echo `date` :$*: :"$@":;; *) echo why not 1>&2 esac for i in a b c; do echo $i done fi is expressed in rc as: if(~ $1 hello) echo hello, world if not Rc also supports more dynamic piping: a , b ''# pipe only standard error of a to b — equivalent to '3>&2 2>&1 >&3 , b' in
Bourne shell The Bourne shell (sh) is a shell command-line interpreter for computer operating systems. It first appeared on Version 7 Unix, as its default shell. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic lin ...
'' a <>b ''# opens file b as a's standard input and
standard output Standard may refer to: Symbols * Colours, standards and guidons, kinds of military signs * Standard (emblem), a type of a large symbol or emblem used for identification Norms, conventions or requirements * Standard (metrology), an object t ...
'' a < < ''# becomes a ,'' # ''better known as " process substitution"''


References


External links

* - 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 Unixarticle
)

{{Unix Shells Free system software Inferno (operating system) Plan 9 from Bell Labs Procedural programming languages Programming languages created in 1989 Scripting languages Text-oriented programming languages Unix shells