124 lines
2.6 KiB
HTML
124 lines
2.6 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>ed(1)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>ed(1)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
ed - editor
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>ed</STRONG> <EM>file</EM>
|
|
|
|
|
|
</PRE>
|
|
<H2>OPTIONS</H2><PRE>
|
|
|
|
<STRONG>-</STRONG> Suppress line/byte count messages (for in scripts)
|
|
|
|
|
|
</PRE>
|
|
<H2>EXAMPLES</H2><PRE>
|
|
|
|
<STRONG>ed</STRONG> <STRONG>prog.c</STRONG> # Edit <EM>prog</EM>.<EM>c</EM>
|
|
|
|
<STRONG>echo</STRONG> <STRONG>'1,$p'</STRONG> <STRONG>|</STRONG> <STRONG>ed</STRONG> <STRONG>-</STRONG> <STRONG>file</STRONG>
|
|
# Odd way to write 'cat file'
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
|
|
<EM>Ed</EM> is functionally equivalent to the standard V7 editor, ed. It supports
|
|
the following commands:
|
|
|
|
(.) a: append
|
|
(.,.) c: change
|
|
(.,.) d: delete
|
|
e: edit new file"
|
|
f: print name of edited file"
|
|
(1,$) g: global command
|
|
(.) i: insert
|
|
(.,.+1) j: join lines together
|
|
(.) k: mark
|
|
(.) l: print with special characters in octal
|
|
(.,.) m: move
|
|
(.,.) p: print
|
|
q: quit editor"
|
|
(.) r: read in new file
|
|
(.,.) s: substitute
|
|
(1,$) v: like g, except select lines that do not match
|
|
(1,$) w: write out edited file
|
|
Many of the commands can take one or two addresses, as indicated above.
|
|
The defaults are shown in parentheses. Thus <EM>a</EM> appends to the current
|
|
line, and <EM>g</EM> works on the whole file as default. The dot refers to the
|
|
current line. Below is a sample editing session with comments given
|
|
following the # symbol.
|
|
|
|
ed prog.c # Edit prog.c
|
|
3,20p # Print lines 3 through 20
|
|
/whole/ # Find next occurence of <EM>whole</EM>
|
|
s/whole/while/ # Replace <EM>whole</EM> by <EM>while</EM>
|
|
g/Buf/s//BUF/g # Replace <EM>Buf</EM> by <EM>BUF</EM> everywhere
|
|
w # Write the file back
|
|
q # Exit the editor
|
|
<EM>Ed</EM> is provided for its sentimental value. If you want a line-oriented
|
|
editor, try <EM>ex</EM>. If you want a good editor, use <EM>elle</EM>, <EM>elvis</EM>, or <EM>mined</EM>.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man1/elvis.1.html">elvis(1)</A></STRONG>, <STRONG><A HREF="../man9/elle.9.html">elle(9)</A></STRONG>, <STRONG><A HREF="../man9/mined.9.html">mined(9)</A></STRONG>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|