How do I use the console based DOS editor (ed.exe)?
We have ed.exe installed because it works over the serial console, and every other editor we tried wouldn't. If you have video/keyboard available you could use something more civilized.
ed is similar to the 'ed' version found on a Unix system. Ed has two modes:
* command mode (where you enter commands)
* edit mode(where you type text).
basic commands needed to know:
(default lines affected are shown in parenthesis)
(.,.)p
prints out specified line(s)
(.)a
appends text after specified line
(.)c
changes specified line
(.,.)d
deletes specified line(s)
.
refers to current line. When in edit mode, on a seperate line by itself, exits edit mode and enters edit mode
n
move to specified n line number.
$
specifies last line in buffer
w(file)
saves (write) file. defaults to currently open file if none specified
q
soft quit.. Will not exit program if file has not been saved after changes were made.
Q
hard quit. Exits program whether or not changes were saved.
over ride defaults to affect more than one line. to print out entire buffer, type 1,$p To move to first line in buffer, type a period;to move to last line, type a dollar sign.