<s>
RUNCOM	B-Device
is	O
a	O
CTSS	B-Operating_System
macro	O
command	O
(	O
script	O
)	O
processor	O
.	O
</s>
<s>
Louis	O
Pouzin	O
created	O
RUNCOM	B-Device
for	O
CTSS	B-Operating_System
circa	O
1963	O
.	O
</s>
<s>
He	O
wrote	O
a	O
paper	O
in	O
1965	O
describing	O
a	O
design	O
for	O
the	O
Multics	B-Application
shell	O
which	O
includes	O
a	O
brief	O
description	O
of	O
RUNCOM	B-Device
followed	O
by	O
a	O
second	O
paper	O
he	O
wrote	O
five	O
days	O
later	O
describing	O
a	O
design	O
for	O
RUNCOM	B-Device
that	O
added	O
commands	O
for	O
control	O
flow	O
,	O
conditional	O
branching	O
and	O
looping	O
.	O
</s>
<s>
In	O
the	O
context	O
of	O
Unix-like	O
systems	O
,	O
the	O
term	O
rc	B-Operating_System
stands	O
for	O
the	O
phrase	O
"	O
run	B-Device
commands	I-Device
"	O
.	O
</s>
<s>
Tom	O
Van	O
Vleck	O
,	O
a	O
Multics	B-Application
engineer	O
,	O
has	O
also	O
reminisced	O
about	O
the	O
extension	O
rc	B-Operating_System
:	O
"	O
The	O
idea	O
of	O
having	O
the	O
command	O
processing	O
shell	O
be	O
an	O
ordinary	O
slave	O
program	O
came	O
from	O
the	O
Multics	B-Application
design	O
,	O
and	O
a	O
predecessor	O
program	O
on	O
CTSS	B-Operating_System
by	O
Louis	O
Pouzin	O
called	O
RUNCOM	B-Device
,	O
the	O
source	O
of	O
the	O
'	O
.rc	B-Device
'	O
suffix	O
on	O
some	O
Unix	B-Application
configuration	O
files.	O
"	O
</s>
<s>
This	O
is	O
also	O
the	O
origin	O
of	O
the	O
name	O
of	O
the	O
Plan	B-Operating_System
9	I-Operating_System
from	I-Operating_System
Bell	I-Operating_System
Labs	I-Operating_System
shell	O
by	O
Tom	O
Duff	O
,	O
the	O
rc	B-Operating_System
shell	I-Operating_System
.	O
</s>
<s>
It	O
is	O
called	O
"	O
rc	B-Operating_System
"	O
because	O
the	O
main	O
job	O
of	O
a	O
shell	O
is	O
to	O
"	O
run	B-Device
commands	I-Device
"	O
.	O
</s>
<s>
While	O
not	O
historically	O
precise	O
,	O
rc	B-Operating_System
may	O
also	O
be	O
expanded	O
as	O
"	O
run	O
control	O
"	O
,	O
because	O
an	O
rc	B-Protocol
file	I-Protocol
controls	O
how	O
a	O
program	O
runs	O
.	O
</s>
<s>
For	O
instance	O
,	O
the	O
editor	O
Vim	B-Application
looks	O
for	O
and	O
reads	O
the	O
contents	O
of	O
the	O
.vimrc	O
file	O
to	O
determine	O
its	O
initial	O
configuration	O
.	O
</s>
<s>
In	O
The	O
Art	O
of	O
Unix	B-Application
Programming	O
,	O
Eric	O
S	O
.	O
Raymond	O
consistently	O
refers	O
to	O
rc	B-Protocol
files	I-Protocol
as	O
"	O
run-control	O
"	O
files	O
.	O
</s>
<s>
RUNCOM	B-Device
is	O
not	O
a	O
shell	O
in	O
the	O
sense	O
of	O
the	O
UNIX	B-Application
shell	O
.	O
</s>
<s>
When	O
you	O
type	O
commands	O
into	O
CTSS	B-Operating_System
they	O
go	O
to	O
the	O
supervisor	O
(	O
kernel	O
)	O
,	O
not	O
any	O
UNIX-shell-like	O
program	O
.	O
</s>
<s>
You	O
cannot	O
type	O
commands	O
into	O
RUNCOM	B-Device
,	O
it	O
processes	O
disk	O
files	O
.	O
</s>
<s>
CTSS	B-Operating_System
files	O
have	O
first	O
name	O
and	O
a	O
second	O
name	O
separated	O
by	O
spaces	O
,	O
e.g.	O
</s>
<s>
RUNCOM	B-Device
command	O
chains	O
also	O
known	O
as	O
macro-commands	O
(	O
both	O
terms	O
mean	O
scripts	O
)	O
are	O
files	O
with	O
a	O
second	O
name	O
of	O
either	O
RUNCOM	B-Device
or	O
BCD	O
which	O
contain	O
zero	O
or	O
more	O
lines	O
.	O
</s>
<s>
Lines	O
in	O
the	O
script	O
are	O
either	O
blank	O
lines	O
,	O
comments	O
,	O
regular	O
commands	O
(	O
the	O
kind	O
that	O
could	O
be	O
entered	O
on	O
the	O
supervisor	O
's	O
command	O
line	O
)	O
or	O
the	O
pseudo-command	O
(	O
command	O
built	O
into	O
RUNCOM	B-Device
only	O
)	O
CHAIN	O
.	O
</s>
<s>
Comments	O
using	O
$	O
are	O
printed	O
(	O
including	O
the	O
$	O
)	O
when	O
RUNCOM	B-Device
runs	O
while	O
ones	O
with	O
*	O
are	O
not	O
printed	O
at	O
all	O
.	O
</s>
<s>
When	O
you	O
invoke	O
RUNCOM	B-Device
,	O
the	O
arguments	O
(	O
parameters	O
)	O
to	O
it	O
must	O
first	O
start	O
with	O
the	O
first	O
name	O
of	O
the	O
file	O
containing	O
the	O
script	O
.	O
</s>
<s>
If	O
you	O
invoke	O
RUNCOM	B-Device
without	O
any	O
arguments	O
it	O
prints	O
some	O
instructions	O
on	O
how	O
to	O
use	O
it	O
and	O
stops	O
,	O
returning	O
you	O
to	O
the	O
supervisor	O
's	O
(	O
system	O
's	O
)	O
command	O
line	O
.	O
</s>
<s>
In	O
the	O
script	O
,	O
CHAIN	O
give	O
names	O
to	O
arguments	O
which	O
were	O
used	O
on	O
the	O
command	O
line	O
when	O
RUNCOM	B-Device
was	O
called	O
,	O
e.g.	O
</s>
<s>
putting	O
CHAIN	O
LALA	O
FAFA	O
in	O
the	O
script	O
and	O
invoking	O
RUNCOM	B-Device
XYZZY	O
3	O
will	O
cause	O
LALA	O
in	O
the	O
script	O
to	O
be	O
substituted	O
into	O
a	O
3	O
when	O
it	O
is	O
used	O
in	O
any	O
lines	O
that	O
come	O
after	O
CHAIN	O
while	O
FAFA	O
will	O
remain	O
FAFA	O
as	O
RUNCOM	B-Device
was	O
invoked	O
without	O
specifying	O
anything	O
for	O
it	O
.	O
</s>
<s>
If	O
an	O
argument	O
to	O
RUNCOM	B-Device
is	O
(	O
NIL	O
)	O
,	O
a	O
positional	O
parameter	O
denoted	O
as	O
an	O
argument	O
to	O
CHAIN	O
in	O
the	O
script	O
will	O
be	O
expand	O
into	O
nothing	O
,	O
e.g.	O
</s>
<s>
CHAIN	O
ALPHA	O
BETA	O
GAMMA	O
combined	O
with	O
RUNCOM	B-Device
A	O
(	O
NIL	O
)	O
B	O
will	O
cause	O
ALPHA	O
to	O
be	O
substituted	O
with	O
A	O
and	O
GAMMA	O
to	O
B	O
while	O
BETA	O
will	O
be	O
removed	O
from	O
any	O
command	O
that	O
follows	O
CHAIN	O
in	O
the	O
script	O
.	O
</s>
<s>
If	O
a	O
RUNCOM	B-Device
argument	O
is	O
(	O
END	O
)	O
the	O
corresponding	O
CHAIN	O
argument	O
will	O
be	O
treated	O
as	O
(	O
NIL	O
)	O
and	O
all	O
subsequent	O
arguments	O
will	O
also	O
be	O
treated	O
as	O
(	O
NIL	O
)	O
.	O
</s>
<s>
An	O
example	O
would	O
be	O
RUNCOM	B-Device
SCRIPT	O
LISTF	O
combined	O
with	O
CHAIN	O
CMD	O
followed	O
by	O
CMD	O
at	O
the	O
start	O
of	O
a	O
following	O
line	O
.	O
</s>
<s>
CMD	O
will	O
be	O
substituted	O
into	O
LISTF	O
which	O
will	O
list	O
the	O
files	O
in	O
the	O
directory	O
(	O
like	O
the	O
Unix	B-Application
ls	O
command	O
)	O
.	O
</s>
<s>
Once	O
the	O
substitutions	O
have	O
been	O
completed	O
,	O
RUNCOM	B-Device
sends	O
the	O
commands	O
to	O
the	O
SCHAIN	O
library	O
subroutine	O
which	O
is	O
available	O
to	O
other	O
programs	O
as	O
well	O
.	O
</s>
