>>28Only Satan could do this.
http://man.cat-v.org/unix_7th/1/ed 5. A regular expression enclosed in slashes `/' addresses
the line found by searching forward from the current
line and stopping at the first line containing a string
that matches the regular expression. If necessary the
search wraps around to the beginning of the buffer.
6. A regular expression enclosed in queries `?' addresses
the line found by searching backward from the current
line and stopping at the first line containing a string
that matches the regular expression. If necessary the
search wraps around to the end of the buffer.
Addresses are separated from each other typically by a comma
`,'. They may also be separated by a semicolon `;'. In
this case the current line `.' is set to the previous
address before the next address is interpreted. This fea-
ture can be used to determine the starting line for forward
and backward searches (`/', `?'). The second address of any
(1, $)w filename
The write command writes the addressed lines onto the
given file. If the file does not exist, it is created
mode 666 (readable and writable by everyone). The file
name is remembered if there was no remembered file name
already. If no file name is given, the remembered file
name, if any, is used (see e and f commands). `.' is
unchanged. If the command is successful, the number of
characters written is printed.
DIAGNOSTICS
`?name' for inaccessible file; `?' for errors in commands;
`?TMP' for temporary file overflow.
BUGS
The l command mishandles DEL.
A ! command cannot be subject to a g command.
Because 0 is an illegal address for a w command, it is not
possible to create an empty file with ed.