System information

2.1.9 Repetitive Command Execution
The macro command M allows you to group ED commands together for repeated evaluation. The
M command takes the following form:
nMCS<cr>
or
nMCS^Z
where CS represents a string of ED commands, not including another M command. ED executes
the command string n times if n>1. If n=0 or 1, the command string is executed repetitively until
an error condition is encountered (for example, the end of the memory buffer is reached with an
F command).
As an example, the following macro changes all occurrences of GAMMA to DELTA within the
current buffer, and types each line that is changed:
MFGAMMA^Z-5DIDELTA^Z0TT<cr>
or equivalently
MSGAMMA^ZDELTA^Z0TT<cr>
2.1 Introduction to ED CP/M Operating System Manual
2-17