Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

rc (Unix shell)

From Wikipedia, the free encyclopedia
Command line interpreter for Version 10 Unix and Plan 9 from Bell Labs operating systems
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Rc" Unix shell – news ·newspapers ·books ·scholar ·JSTOR
(March 2014) (Learn how and when to remove this message)
rc
Paradigmimperative,pipeline
Designed byTom Duff
DeveloperBell Labs
First appeared1989; 37 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, theInferno shell
An rc session

rc (for "run commands") is thecommand-line interpreter forVersion 10 Unix andPlan 9 from Bell Labsoperating systems. It resembles theBourne shell, but its syntax is somewhat simpler. It was created byTom Duff, who is better known for an unusualC programming language construct ("Duff's device").[1]

A port of the original rc to Unix is part ofPlan 9 from User Space. A rewrite of rc forUnix-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'sALGOL-like structures, except that it uses anif not construct instead ofelse in the original implementation but useselse im Byron Rakitzis implementation, and has a Bourne-likefor 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]

Influences

[edit]

es

[edit]

es (for "extensible shell") is anopen source,command line interpreter developed by Rakitzis and Paul Haahr[2] that uses ascripting language syntax influenced by the rc shell.[3][4] It was originally based on code from Byron Rakitzis's clone ofrc for Unix.[5][6]

Extensible shell is intended to provide a fullyfunctionalprogramming language as aUnix shell.[7] It does so by introducing "program fragments" in braces as a new datatype, lexical scoping vialet, and some more minor improvements. The bulk of es development occurred in the early 1990s, after the shell was introduced at the Winter 1993USENIX conference inSan Diego.[8] Official releases appear to have ceased after 0.9-beta-1 in 1997,[9] and es lacks features present in more popular shells, such aszsh andbash.[10] Apublic domain fork ofes is active as of 2019[update].[11]

Examples

[edit]

The Bourne shell script:

if[hello="$1"];thenechohello,worldelsecase$2in1)echo"$#"'hey'"jude's$3";;2)echo`date`:"$*"::"$@":;;*)echowhynot1>&2esacforiinabc;doecho"$i"donefi

is expressed in rc as:

if(~ $1 hello)    echo hello, worldif not {    switch($2) {    case 1        echo $#* 'hey' 'jude''s'^$3    case 2        echo `{date} :$"*: :$*:    case *        echo why not >[1=2]    }    for(i in a b c)        echo $i}

Rc also supports more dynamic piping:

a |[2] b# pipe onlystandard error of a to b — equivalent to '{ a 2>&1 >&3 3>&- | b; } 3>&1' inBourne shell[1]: Advanced I/O Redirection a <{b} <{c}# becomes a {named pipe with standard output of b} {named pipe with standard output of c},# better known as "process substitution"[1]: Pipeline Branching 

References

[edit]
  1. ^abcdDuff, Tom (1990).""Rc — The Plan 9 Shell"".cat-v. Retrieved2024-01-26.
  2. ^Fischer, Manfred M. (13 December 1996).Spatial Analytical Perspectives on GIS. CRC Press.ISBN 9780748403400.
  3. ^"Ubuntu Manpage: es - extensible shell". Manpages.ubuntu.com. 1992-03-05. Archived fromthe original on 2014-02-24. Retrieved2012-08-24.
  4. ^"Extensible Shell". FOLDOC. Retrieved2012-08-24.
  5. ^"Shells Available for Linux". LUV. Archived fromthe original on 2012-03-22. Retrieved2012-08-24.
  6. ^Jones, Tim."Evolution of shells in Linux". IBM. Retrieved14 March 2014.
  7. ^"Linux Journal 12: What's GNU". Archived fromthe original on 2013-01-17. Retrieved2012-08-24.
  8. ^Es: A shell with higher-order functions by Byron Rakitzis,NetApp, Inc, and Paul Haahr,Adobe Systems Incorporated;Archived atArchive.Org.
  9. ^https://web.archive.org/web/20230308211038/ftp://ftp.sys.utoronto.ca/pub/es/
  10. ^"UNIX shell differences". Faqs.org. Retrieved2012-08-24.
  11. ^Haggerty, James (13 March 2020)."wryun/es-shell: a shell with higher-order functions".GitHub.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Rc_(Unix_shell)&oldid=1331014762"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp