Rc (Unix Shell)
   HOME

TheInfoList



OR:

rc (for " run commands") is the command line interpreter for
Version 10 Unix The term "Research Unix" refers to early versions of the Unix operating system for DEC PDP-7, PDP-11, VAX and Interdata 7/32 and 8/32 computers, developed in the Bell Labs Computing Sciences Research Center (CSRC). History The term ''Researc ...
and Plan 9 from Bell Labs operating systems. It resembles the
Bourne shell The Bourne shell (sh) is a Shell (computing), shell Command-line interface#Command-line interpreter, command-line interpreter for computer operating systems. The Bourne shell was the default Unix shell, shell for Version 7 Unix. Unix-like syste ...
, but its syntax is somewhat simpler. It was created by
Tom Duff Tom or TOM may refer to: * Tom (given name), a diminutive of Thomas or Tomás or an independent Aramaic given name (and a list of people with the name) Characters * Tom Anderson, a character in ''Beavis and Butt-Head'' * Tom Beck, a character ...
, who is better known for an unusual
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well as ...
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 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.


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 the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
, command line interpreter developed by Rakitzis and Paul Haahr that uses a scripting language 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 Functional may refer to: * Movements in architecture: ** Functionalism (architecture) ** Form follows function * Functional group, combination of atoms within molecules * Medical conditions without currently visible organic basis: ** Functional sy ...
programming language as a Unix shell. It does so by introducing "program fragments" in braces as a new datatype, lexical scoping via
let Let or LET may refer to: Sports * Let serve, when the served object in certain racket sports hits the net and lands in the correct service court, such as; ** Let (badminton) ** Let (pickleball) ** Let (tennis) * Ladies European Tour, the ladi ...
, 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 conference in San Diego, Official releases appear to have ceased after 0.9-beta-1 in 1997, and es lacks features as compared to more popular shells, such as
zsh The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell (computing), shell and as a command line interpreter, command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including som ...
and
bash Bash or BASH may refer to: Arts and entertainment * ''Bash!'' (Rockapella album), 1992 * ''Bash!'' (Dave Bailey album), 1961 * '' Bash: Latter-Day Plays'', a dramatic triptych * ''BASH!'' (role-playing game), a 2005 superhero game * "Bash" ('' ...
. A public domain fork of is active as of 2019.


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 (computing), shell Command-line interface#Command-line interpreter, command-line interpreter for computer operating systems. The Bourne shell was the default Unix shell, shell for Version 7 Unix. Unix-like syste ...
'' a <>b ''# opens file b as a's standard input and standard output'' a < < ''# becomes a ,'' # ''better known as "
process substitution In computing, process substitution is a form of inter-process communication that allows the input or output of a command to appear as a file. The command is substituted in-line, where a file name would normally occur, by the command shell. This all ...
"''


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