Files
oldlinux-files/Minix/CD-ROM-2.0/MINIX/MANUALS/CAT1/ED.1
2024-02-19 00:21:39 -05:00

119 lines
2.4 KiB
Groff
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
ED(1) Minix Programmer's Manual ED(1)
NAME
ed - editor
SYNOPSIS
ed file
OPTIONS
- Suppress line/byte count messages (for in scripts)
EXAMPLES
ed prog.c # Edit prog.c
echo '1,$p' | ed - file
# Odd way to write 'cat file'
DESCRIPTION
Ed 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 a appends to the current
line, and g 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 whole
s/whole/while/ # Replace whole by while
g/Buf/s//BUF/g # Replace Buf by BUF everywhere
1
ED(1) Minix Programmer's Manual ED(1)
w # Write the file back
q # Exit the editor
Ed is provided for its sentimental value. If you want a line-oriented
editor, try ex. If you want a good editor, use elle, elvis, or mined.
SEE ALSO
elvis(1), elle(9), mined(9).
2