<s>
(	O
pronounced	O
as	O
distinct	O
letters	O
,	O
)	O
is	O
a	O
line	B-Application
editor	I-Application
for	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
.	O
</s>
<s>
It	O
was	O
one	O
of	O
the	O
first	O
parts	O
of	O
the	O
Unix	B-Application
operating	I-Application
system	I-Application
that	O
was	O
developed	O
,	O
in	O
August	O
1969	O
.	O
</s>
<s>
It	O
remains	O
part	O
of	O
the	O
POSIX	O
and	O
Open	B-Application
Group	I-Application
standards	O
for	O
Unix-based	O
operating	O
systems	O
,	O
alongside	O
the	O
more	O
sophisticated	O
full-screen	O
editor	B-Application
vi	B-Application
.	O
</s>
<s>
The	O
ed	B-Application
text	I-Application
editor	I-Application
was	O
one	O
of	O
the	O
first	O
three	O
key	O
elements	O
of	O
the	O
Unix	B-Application
operating	I-Application
system	I-Application
—	O
assembler	O
,	O
editor	B-Application
,	O
and	O
shell	B-Application
—	O
developed	O
by	O
Ken	O
Thompson	O
in	O
August	O
1969	O
on	O
a	O
PDP-7	B-Device
at	O
AT&T	O
Bell	O
Labs	O
.	O
</s>
<s>
Many	O
features	O
of	O
ed	B-Application
came	O
from	O
the	O
qed	B-Application
text	I-Application
editor	I-Application
developed	O
at	O
Thompson	O
's	O
alma	O
mater	O
University	O
of	O
California	O
,	O
Berkeley	O
.	O
</s>
<s>
Thompson	O
was	O
very	O
familiar	O
with	O
qed	B-Application
,	O
and	O
had	O
reimplemented	O
it	O
on	O
the	O
CTSS	B-Operating_System
and	O
Multics	B-Application
systems	O
.	O
</s>
<s>
Thompson	O
's	O
versions	O
of	O
qed	B-Application
were	O
notable	O
as	O
the	O
first	O
to	O
implement	O
regular	B-Language
expressions	I-Language
.	O
</s>
<s>
Regular	B-Language
expressions	I-Language
are	O
also	O
implemented	O
in	O
ed	B-Application
,	O
though	O
their	O
implementation	O
is	O
considerably	O
less	O
general	O
than	O
that	O
in	O
qed	B-Application
.	O
</s>
<s>
Dennis	O
M	O
.	O
Ritchie	O
produced	O
what	O
Doug	O
McIlroy	O
later	O
described	O
as	O
the	O
"	O
definitive	O
"	O
ed	B-Application
,	O
and	O
aspects	O
of	O
ed	B-Application
went	O
on	O
to	O
influence	O
ex	B-Device
,	O
which	O
in	O
turn	O
spawned	O
vi	B-Application
.	O
</s>
<s>
The	O
non-interactive	O
Unix	B-Application
command	I-Application
grep	B-Application
was	O
inspired	O
by	O
a	O
common	O
special	O
use	O
of	O
qed	B-Application
and	O
later	O
ed	B-Application
,	O
where	O
the	O
command	O
g/re/p	B-Application
means	O
globally	O
search	O
for	O
the	O
regular	B-Language
expression	I-Language
re	O
and	O
print	O
the	O
lines	O
containing	O
it	O
.	O
</s>
<s>
The	O
Unix	B-Application
stream	B-Application
editor	I-Application
,	O
sed	B-Application
implemented	O
many	O
of	O
the	O
scripting	O
features	O
of	O
qed	B-Application
that	O
were	O
not	O
supported	O
by	O
ed	B-Application
on	O
Unix	B-Application
.	O
</s>
<s>
Features	O
of	O
ed	B-Application
include	O
:	O
</s>
<s>
available	O
on	O
essentially	O
all	O
Unix	B-Application
systems	I-Application
(	O
and	O
mandatory	O
on	O
systems	O
conforming	O
to	O
the	O
Single	O
Unix	B-Application
Specification	O
)	O
.	O
</s>
<s>
(	O
In	O
)	O
famous	O
for	O
its	O
terseness	O
,	O
ed	B-Application
gives	O
almost	O
no	O
visual	O
feedback	O
,	O
and	O
has	O
been	O
called	O
(	O
by	O
Peter	O
H	O
.	O
Salus	O
)	O
"	O
the	O
most	O
user-hostile	O
editor	B-Application
ever	O
created	O
"	O
,	O
even	O
when	O
compared	O
to	O
the	O
contemporary	O
(	O
and	O
notoriously	O
complex	O
)	O
TECO	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
the	O
message	O
that	O
ed	B-Application
will	O
produce	O
in	O
case	O
of	O
error	O
,	O
and	O
when	O
it	O
wants	O
to	O
make	O
sure	O
the	O
user	O
wishes	O
to	O
quit	O
without	O
saving	O
,	O
is	O
"	O
?	O
"	O
.	O
</s>
<s>
Older	O
versions	O
(	O
c	B-Language
.	O
1981	O
)	O
did	O
not	O
even	O
ask	O
for	O
confirmation	O
when	O
a	O
quit	O
command	O
was	O
issued	O
without	O
the	O
user	O
saving	O
changes	O
.	O
</s>
<s>
This	O
terseness	O
was	O
appropriate	O
in	O
the	O
early	O
versions	O
of	O
Unix	B-Application
,	O
when	O
consoles	O
were	O
teletypes	O
,	O
modems	B-Application
were	O
slow	O
,	O
and	O
memory	B-Architecture
was	O
precious	O
.	O
</s>
<s>
In	O
current	O
practice	O
,	O
ed	B-Application
is	O
rarely	O
used	O
interactively	O
,	O
but	O
does	O
find	O
use	O
in	O
some	O
shell	B-Language
scripts	I-Language
.	O
</s>
<s>
For	O
interactive	O
use	O
,	O
ed	B-Application
was	O
subsumed	O
by	O
the	O
sam	B-Application
,	O
vi	B-Application
and	O
Emacs	B-Application
editors	O
in	O
the	O
1980s	O
.	O
</s>
<s>
ed	B-Application
can	O
be	O
found	O
on	O
virtually	O
every	O
version	O
of	O
Unix	B-Application
and	O
Linux	B-Application
available	O
,	O
and	O
as	O
such	O
is	O
useful	O
for	O
people	O
who	O
have	O
to	O
work	O
with	O
multiple	O
versions	O
of	O
Unix	B-Application
.	O
</s>
<s>
On	O
Unix-based	O
operating	O
systems	O
,	O
some	O
utilities	O
like	O
SQL*Plus	B-Application
run	O
ed	B-Application
as	O
the	O
editor	B-Application
if	O
the	O
EDITOR	B-Application
and	O
VISUAL	O
environment	O
variables	O
are	O
not	O
defined	O
.	O
</s>
<s>
If	O
something	O
goes	O
wrong	O
,	O
ed	B-Application
is	O
sometimes	O
the	O
only	O
editor	B-Application
available	O
.	O
</s>
<s>
The	O
version	O
of	O
ed	B-Application
provided	O
by	O
GNU	B-Operating_System
has	O
a	O
few	O
switches	O
to	O
enhance	O
the	O
feedback	O
.	O
</s>
<s>
The	O
ed	B-Application
commands	O
are	O
often	O
imitated	O
in	O
other	O
line-based	O
editors	O
.	O
</s>
<s>
For	O
example	O
,	O
EDLIN	B-Application
in	O
early	O
MS-DOS	B-Application
versions	O
and	O
32-bit	O
versions	O
of	O
Windows	B-Device
NT	I-Device
has	O
a	O
somewhat	O
similar	O
syntax	O
,	O
and	O
text	B-Application
editors	I-Application
in	O
many	O
MUDs	B-Application
(	O
LPMud	B-Application
and	O
descendants	O
,	O
for	O
example	O
)	O
use	O
ed-like	O
syntax	O
.	O
</s>
<s>
Here	O
is	O
an	O
example	O
transcript	O
of	O
an	O
ed	B-Application
session	O
.	O
</s>
<s>
For	O
clarity	O
,	O
commands	O
and	O
text	O
typed	O
by	O
the	O
user	O
are	O
in	O
normal	O
face	O
,	O
and	O
output	O
from	O
ed	B-Application
is	O
emphasized	O
.	O
</s>
<s>
ed	B-Application
is	O
the	O
standard	O
Unix	B-Application
text	B-Application
editor	I-Application
.	O
</s>
<s>
Started	O
with	O
an	O
empty	O
file	O
,	O
the	O
a	O
command	O
appends	O
text	O
(	O
all	O
ed	B-Application
commands	O
are	O
single	O
letters	O
)	O
.	O
</s>
<s>
The	O
command	O
puts	O
ed	B-Application
in	O
insert	O
mode	O
,	O
inserting	O
the	O
characters	O
that	O
follow	O
and	O
is	O
terminated	O
by	O
a	O
single	O
dot	O
on	O
a	O
line	O
.	O
</s>
<s>
In	O
return	O
,	O
ed	B-Application
lists	O
all	O
lines	O
,	O
from	O
first	O
to	O
last	O
.	O
</s>
<s>
w	O
text	O
writes	O
the	O
buffer	O
to	O
the	O
file	O
"	O
text	O
"	O
making	O
ed	B-Application
respond	O
with	O
65	O
,	O
the	O
number	O
of	O
characters	O
written	O
to	O
the	O
file	O
.	O
</s>
<s>
q	O
will	O
end	O
an	O
ed	B-Application
session	O
.	O
</s>
<s>
The	O
GNU	B-Operating_System
project	O
has	O
numerous	O
jokes	O
around	O
ed	B-Application
hosted	O
on	O
its	O
website	O
.	O
</s>
<s>
In	O
addition	O
,	O
the	O
glibc	B-Language
documentation	O
notes	O
an	O
error	B-Error_Name
code	I-Error_Name
called	O
with	O
its	O
description	O
(	O
errorstr	O
)	O
merely	O
a	O
single	O
question	O
mark	O
,	O
noting	O
"	O
the	O
experienced	O
user	O
will	O
know	O
what	O
is	O
wrong.	O
"	O
</s>
