Content deleted Content added
Undid revision 753889066 by 90.218.219.252 (talk) - vandalism |
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5 |
||
(48 intermediate revisions by 31 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}}
Line 13:
| latest_test_version =
| latest_test_date =
| typing = [[weak typing|weak]]
| implementations =
| dialects = Byron's rc
| influenced_by = [[Bourne shell]]
| influenced = [[#es
| 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
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
==Influences== <!--Anchor from redirected [
===es===
''es'' (for "extensible shell") is an [[
Extensible shell is intended to provide a fully [[functional programming|functional]] [[programming language]] as a [[Unix shell]].<ref>{{cite web
==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==
Line 44 ⟶ 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]
{{Unix Shells}}
[[Category:Plan 9 from Bell Labs]]▼
[[Category:Free system software]]
[[Category:
[[Category:
[[Category:Text-oriented programming languages]]▼
[[Category:Procedural programming languages]]
[[Category:Programming languages created in 1989]]
[[Category:Scripting languages]]
▲[[Category:Text-oriented programming languages]]
|