Content deleted Content added
No edit summary Tags: Visual edit repeating characters |
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5 |
||
(42 intermediate revisions by 26 users not shown) | |||
Line 1:
{{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 =
| 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] article; caution with changes. -->
===es===
''es'' (for "extensible shell") is an [[open source]], [[command line interpreter]] developed by Rakitzis and Paul Haahr
Extensible shell is intended to provide a fully [[functional programming|functional]] [[programming language]] as a [[Unix shell]].<ref>{{cite web
==Examples==
<
if [ "$1" = "hello" ]; then
echo hello, world
Line 28 ⟶ 52:
done
fi
</syntaxhighlight>
is expressed in rc as:
<
if(~ $1 hello)
echo hello, world
Line 47 ⟶ 71:
echo $i
}
</syntaxhighlight>
Rc also supports more dynamic piping:
a |[2] b ''# pipe only [[standard error stream|standard error]] of a to b —
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==
Line 61 ⟶ 84:
==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]
|