Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Rc (Unix shell)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Command line interpreter for Version 10 Unix and Plan 9 from Bell Labs operating systems}} {{lowercase|title=rc}} {{refimprove|date=March 2014}} {{Infobox programming language | name = rc | logo = | paradigm = [[Imperative programming|imperative]], [[Pipeline programming|pipeline]] | year = {{Start date and age|1989}} | designer = [[Tom Duff]] | developer = [[Bell Labs]] | latest_release_version = | latest_release_date = | latest_test_version = | latest_test_date = | source_model = [[Open source]] | typing = [[weak typing|weak]] | implementations = | dialects = Byron's rc | influenced_by = [[Bourne shell]] | influenced = [[#es|es]], the [[Inferno (operating system)|Inferno]] shell | operating_system = [[Cross-platform]] ([[Version 10 Unix]], [[Plan 9 from Bell Labs|Plan 9]], [[Plan 9 from User Space]]) | license = | website = }} [[File:Plan 9 from Bell Labs (process management).png|thumb|An rc session]] '''rc''' (for "[[run commands]]") 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)|C programming language]] construct ("[[Duff's device]]").<ref name="RCTD">{{Cite web |last=Duff |first=Tom |date=1990 |title="Rc β The Plan 9 Shell" |url=http://doc.cat-v.org/plan_9/4th_edition/papers/rc |access-date=2024-01-26 |website=cat-v}}</ref> 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 <code>if not</code> construct instead of <code>else</code>, and has a Bourne-like <code>for</code> loop to iterate over lists. In rc, all variables are lists of strings, which eliminates the need for constructs like <code>[[$@|"$@"]]</code>. Variables are not re-split when expanded. The language is described in Duff's paper.<ref name=RCTD/> ==Influences== <!--Anchor from redirected [[Es (Unix shell)]] article; caution with changes. --> ===es=== ''es'' (for "extensible shell") is an [[open source]], [[command line interpreter]] developed by Rakitzis and Paul Haahr<ref>{{cite book | url=https://books.google.com/books?id=iEK6eQQwOF0C&pg=PA43 | title=Spatial Analytical Perspectives on GIS| isbn=9780748403400| last1=Fischer| first1=Manfred M.| date=13 December 1996| publisher=CRC Press}}</ref> that uses a [[scripting language]] syntax influenced by the rc shell.<ref>{{cite web |url=http://manpages.ubuntu.com/manpages/hardy/man1/es.1.html |title=Ubuntu Manpage: es - extensible shell |publisher=Manpages.ubuntu.com |date=1992-03-05 |access-date=2012-08-24 |url-status=dead |archive-url=https://web.archive.org/web/20140224211945/http://manpages.ubuntu.com/manpages/hardy/man1/es.1.html |archive-date=2014-02-24 }}</ref><ref>{{cite web | url=http://foldoc.org/Extensible+Shell |title=Extensible Shell |publisher=FOLDOC |access-date=2012-08-24}}</ref> It was originally based on code from Byron Rakitzis's clone of [[rc shell|rc]] for Unix.<ref>{{cite web | url=http://luv.asn.au/overheads/shells-talk.html |title=Shells Available for Linux |publisher=LUV |access-date=2012-08-24}}</ref><ref>{{cite web|last=Jones|first=Tim|title=Evolution of shells in Linux|url=http://www.ibm.com/developerworks/library/l-linux-shells/|publisher=IBM|access-date=14 March 2014}}</ref> Extensible shell is intended to provide a fully [[functional programming|functional]] [[programming language]] as a [[Unix shell]].<ref>{{cite web|url=http://nnc3.com/lj/LJ/LJ12/0062.html|title=Linux Journal 12: What's GNU|access-date=2012-08-24|url-status=dead|archive-url=https://web.archive.org/web/20130117064248/http://nnc3.com/lj/LJ/LJ12/0062.html|archive-date=2013-01-17}}</ref> It does so by introducing "program fragments" in braces as a new datatype, lexical scoping via [[Let expression|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]] conference in [[San Diego]].<ref>[http://stuff.mit.edu/afs/sipb/user/yandros/doc/es-usenix-winter93.html Es: A shell with higher-order functions] by Byron Rakitzis, [[NetApp|NetApp, Inc]], and Paul Haahr, [[Adobe Systems Incorporated]]; <u>Archived</u> at [https://web.archive.org/web/20090415213858/http://192.220.96.201/es/es-usenix-winter93.html Archive.Org].</ref> Official releases appear to have ceased after 0.9-beta-1 in 1997,<ref>[https://web.archive.org/web/20230308211038/ftp://ftp.sys.utoronto.ca/pub/es/]</ref> and es lacks features present in more popular shells, such as [[zsh]] and [[Bash (Unix shell)|bash]].<ref>{{cite web | url=http://www.faqs.org/faqs/unix-faq/shell/shell-differences/ |title=UNIX shell differences| publisher=Faqs.org | access-date=2012-08-24}}</ref> A [[public domain]] fork of {{code|es}} is active {{as of|2019|lc=yes}}.<ref>{{cite web |last1=Haggerty |first1=James |title=wryun/es-shell: a shell with higher-order functions |url=http://wryun.github.io/es-shell/ |website=GitHub |date=13 March 2020}}</ref> ==Examples== The Bourne shell script: <syntaxhighlight lang="bash"> 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 </syntaxhighlight> is expressed in rc as: <syntaxhighlight lang="text"> if(~ $1 hello) echo hello, world if 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 } </syntaxhighlight> Rc also supports more dynamic piping: a |[2] b ''# pipe only [[standard error stream|standard error]] of a to b β equivalent to '3>&2 2>&1 >&3 | b' in [[Bourne shell]]''<ref name=RCTD/>{{rp|at=Advanced I/O Redirection}} a <>b ''# opens file b as a's [[standard input]] and [[standard output]]'' a <{b} <{c} ''# becomes a {standard output of b} {standard output of c},'' # ''better known as "[[process substitution]]"''<ref name=RCTD/>{{rp|at=Pipeline Branching}} ==References== {{reflist|25em}} ==External links== *{{man|1|rc|Plan 9||inline}} - Plan 9 manual page *[https://9fans.github.io/plan9port/ Plan 9 from User Space] - Includes rc and other Plan 9 tools for Linux, Mac OS X and other Unix-like systems *[https://github.com/rakitzis/rc Byron Rakitzis' rewrite for Unix] ([http://tobold.org/article/rc article] {{Webarchive|url=https://web.archive.org/web/20131005004955/http://tobold.org/article/rc |date=2013-10-05 }}) *[http://hawkwind.utcs.utoronto.ca:8001/mlists/es.html es Official website] {{Unix Shells}} [[Category:Free system software]] [[Category:Inferno (operating system)]] [[Category:Plan 9 from Bell Labs]] [[Category:Procedural programming languages]] [[Category:Programming languages created in 1989]] [[Category:Scripting languages]] [[Category:Text-oriented programming languages]] [[Category:Unix shells]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:As of
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Lowercase
(
edit
)
Template:Man
(
edit
)
Template:Refimprove
(
edit
)
Template:Reflist
(
edit
)
Template:Rp
(
edit
)
Template:Short description
(
edit
)
Template:Unix Shells
(
edit
)
Template:Webarchive
(
edit
)