ed
The form of a ed command
[address [,address]]command[parameters]
- The addresses are like those of sed with many extensions:
- . for the present line
- - and + for the previous and next line
- % for the whole document
- /re/ for the next line matching re
- ?re? for the previous line matching re
- etc...
- Some of the commands are
- a append text to the selected line
- d detele the selected lines from buffer
- g/re/command-list apply command-list to each of the addressed lines matching re
- p print the selected lines
- s/re/repl/fl substitute re with repl
- w file write buffer to file
- q quit