18 .FL "\-" "Suppress line/byte count messages (for in scripts)"
20 .EX "ed prog.c" "Edit \fIprog.c\fR"
21 .EX "echo '1,$p' | ed - file" "Odd way to write 'cat file'"
24 \fIEd\fR is functionally equivalent to the standard V7 editor, ed.
25 It supports the following commands:
33 f: print name of edited file"
34 (1,$) g: global command
36 (.,.+1) j: join lines together
38 (.) l: print with special characters in octal
42 (.) r: read in new file
44 (1,$) v: like g, except select lines that do not match
45 (1,$) w: write out edited file
47 Many of the commands can take one or two addresses, as indicated above. The
48 defaults are shown in parentheses. Thus \fIa\fR appends to the current
49 line, and \fIg\fR works on the whole file as default.
50 The dot refers to the current line.
51 Below is a sample editing session with comments given following the # symbol.
55 ed prog.c # Edit prog.c
56 3,20p # Print lines 3 through 20
57 /whole/ # Find next occurence of \fIwhole\fR
58 s/whole/while/ # Replace \fIwhole\fR by \fIwhile\fR
59 g/Buf/s//BUF/g # Replace \fIBuf\fR by \fIBUF\fR everywhere
60 w # Write the file back
63 \fIEd\fR is provided for its sentimental value.
64 If you want a line-oriented editor, try \fIex\fR.
65 If you want a good editor, use \fIelle\fR, \fIelvis\fR, or \fImined\fR.