<s>
In	O
computing	O
,	O
command	B-Device
substitution	I-Device
is	O
a	O
facility	O
that	O
allows	O
a	O
command	O
to	O
be	O
run	O
and	O
its	O
output	O
to	O
be	O
pasted	O
back	O
on	O
the	O
command	O
line	O
as	O
arguments	O
to	O
another	O
command	O
.	O
</s>
<s>
Command	B-Device
substitution	I-Device
first	O
appeared	O
in	O
the	B-Device
Bourne	I-Device
shell	I-Device
,	O
introduced	O
with	O
Version	B-Operating_System
7	I-Operating_System
Unix	I-Operating_System
in	O
1979	O
,	O
and	O
has	O
remained	O
a	O
characteristic	O
of	O
all	O
later	O
Unix	B-Application
shells	I-Application
.	O
</s>
<s>
The	O
feature	O
has	O
since	O
been	O
adopted	O
in	O
other	O
programming	O
languages	O
as	O
well	O
,	O
including	O
Perl	B-Language
,	O
PHP	B-Application
,	O
Ruby	B-Language
and	O
Microsoft	O
's	O
Powershell	B-Application
under	O
Windows	O
.	O
</s>
<s>
It	O
also	O
appears	O
in	O
Microsoft	O
's	O
CMD.EXE	B-Device
in	O
the	O
FOR	O
command	O
and	O
the	O
(	O
)	O
command	O
.	O
</s>
<s>
Shells	O
typically	O
implement	O
command	B-Device
substitution	I-Device
by	O
creating	O
a	O
child	B-Operating_System
process	I-Operating_System
to	O
run	O
the	O
first	O
command	O
with	O
its	O
standard	O
output	O
piped	B-Operating_System
back	O
to	O
the	O
shell	O
,	O
which	O
reads	O
that	O
output	O
,	O
parsing	B-Language
it	O
into	O
words	O
separated	O
by	O
whitespace	O
.	O
</s>
<s>
Because	O
the	O
shell	O
ca	O
n't	O
know	O
it	O
has	O
all	O
the	O
output	O
from	O
the	O
child	O
until	O
the	O
pipe	O
closes	O
or	O
the	O
child	O
dies	O
,	O
it	O
waits	O
until	O
then	O
before	O
it	O
starts	O
another	O
child	B-Operating_System
process	I-Operating_System
to	O
run	O
the	O
second	O
command	O
.	O
</s>
<s>
This	O
C	B-Operating_System
shell	I-Operating_System
example	O
shows	O
how	O
one	O
might	O
search	O
for	O
all	O
the	O
C	B-Language
files	O
containing	O
the	O
string	O
malloc	O
using	O
fgrep	B-Device
and	O
then	O
edit	O
any	O
that	O
are	O
found	O
using	O
the	O
vi	B-Application
editor	I-Application
.	O
</s>
<s>
The	O
syntactical	O
notation	O
shown	O
here	O
,	O
`	O
...	O
`	O
,	O
using	O
backquotes	O
as	O
delimiters	B-Algorithm
,	O
is	O
the	O
original	O
style	O
and	O
is	O
supported	O
by	O
all	O
the	O
common	O
Unix	B-Application
shells	I-Application
.	O
</s>
<s>
While	O
easy	O
to	O
type	O
,	O
an	O
important	O
factor	O
for	O
an	O
interactive	O
command	O
processor	O
,	O
the	O
syntax	O
has	O
been	O
criticized	O
as	O
awkward	O
to	O
nest	O
,	O
putting	O
one	O
command	B-Device
substitution	I-Device
inside	O
another	O
,	O
because	O
both	O
the	O
left	O
and	O
the	O
right	O
delimiters	B-Algorithm
are	O
the	O
same	O
.	O
</s>
<s>
The	O
KornShell	B-Language
(	O
ksh	O
)	O
solved	O
this	O
with	O
an	O
alternative	O
notation	O
,	O
$( 	O
...	O
)	O
,	O
borrowing	O
from	O
the	O
notational	O
style	O
used	O
for	O
variable	O
substitution	O
.	O
</s>
<s>
Today	O
,	O
most	O
UNIX	B-Application
shells	I-Application
support	O
this	O
syntax	O
.	O
</s>
<s>
Microsoft	O
's	O
PowerShell	B-Application
also	O
uses	O
this	O
notation	O
,	O
with	O
the	O
same	O
semantics	O
.	O
</s>
<s>
It	O
worked	O
well	O
on	O
early	O
Unix	B-Application
systems	I-Application
where	O
filenames	O
never	O
contained	O
spaces	O
but	O
it	O
does	O
n't	O
work	O
at	O
all	O
well	O
on	O
modern	O
Windows	O
and	O
Linux	B-Application
systems	O
where	O
filenames	O
certainly	O
can	O
contain	O
spaces	O
.	O
</s>
<s>
In	O
either	O
of	O
these	O
previous	O
examples	O
,	O
if	O
any	O
of	O
the	O
filenames	O
matched	O
by	O
the	O
*	O
.c	B-Language
wildcard	O
contains	O
a	O
space	O
,	O
that	O
filename	O
will	O
be	O
broken	O
into	O
two	O
separate	O
arguments	O
to	O
vi	B-Application
,	O
clearly	O
not	O
what	O
was	O
intended	O
.	O
</s>
<s>
Hamilton	B-Device
C	I-Device
shell	I-Device
solved	O
this	O
with	O
a	O
double	O
backquote	O
notation	O
,	O
``	O
...	O
``	O
,	O
that	O
parses	B-Language
into	O
words	O
only	O
at	O
line	O
breaks	O
.	O
</s>
<s>
using	O
the	O
(	O
)	O
operator	O
in	O
PowerShell	B-Application
:	O
</s>
<s>
A	O
related	O
facility	O
,	O
expression	O
substitution	O
,	O
is	O
found	O
in	O
the	O
languages	O
Common	B-Language
Lisp	I-Language
and	O
Scheme	B-Language
,	O
invoked	O
by	O
using	O
the	O
comma-at	O
operator	O
in	O
an	O
expression	O
marked	O
with	O
the	O
backquote	O
(	O
or	O
"	O
quasiquote	O
"	O
)	O
operator	O
,	O
and	O
in	O
ABC	B-Language
,	O
by	O
using	O
an	O
expression	O
enclosed	O
between	O
backquotes	O
inside	O
a	O
text	O
display	O
(	O
string	B-Language
literal	I-Language
)	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
ABC	B-Language
command	O
produces	O
the	O
output	O
.	O
</s>
