MPE/iX Shell and Utilities Reference Manual, Vol 1

ed(1) MPE/iX Shell and Utilities ed(1)
displays a count of the bytes in the file unless it is in quiet mode. If you have
changed the current buffer since the last time its contents were written out, ed dis-
plays a warning message and does not execute the command. If you enter the e com-
mand a second time, ed and executes the command.
f [file] changes the remembered file name to file. ed displays the new remembered file
name. If you do not specify file, ed displays the current remembered file name.
1,$G/regexp/
is similar to the g command except that when ed finds a line that matches regexp,it
displays the line and waits for you to type in the command to be executed. You can-
not use the a,c,i,G,g,V,and v commands. If you enter &, the G command
re-executes the last command you typed in. If you press ENTER, G does not execute
any command for that line.
1,$g/regexp/command
performs command on all lines that contain strings matching the regular expression
regexp. This command works in two passes. In the first pass, ed searches the given
range of lines and marks all those that contain strings matching the regular expres-
sion regexp, while the second pass actually performs command on those lines. You
cannot use !, G, g, V,orv as command. command consists of one or more ed com-
mands, the first of which must appear on the same line as the g commands. All lines
of a multi-line command list, except the last, must end with a backslash (\). If com-
mand is empty, ed assumes it to be the p command. If no lines match regexp, ed
does not change the current line number; otherwise, the current line number is the
one set by the last command in command. You can use any character other than
space or newline instead of the slash (/) to delimit regexp.
H tells ed to display more descriptive messages when errors occur. If ed is already
displaying descriptive messages, because of a previous H command, issuing the H
commands returns to terse error messages. Normally, ed indicates error messages by
displaying a ?. When you turn on descriptive error messages with this command, ed
also displays the descriptive message for the most recent ? message (see the descrip-
tion of the h command).
h provides a brief explanation of the last error that occurred. This does not change the
current line number.
.i works similarly to the a command except that ed places the text before the addressed
line. Valid addresses range from line 1 to $ (the last line). ed sets the current line
number to the last inserted line.
.,.+1j joins a range of lines into one line. To be precise, the j command removes all new-
line characters from the addressed range of lines, except for the last one. ed sets the
current line number to the resulting combined line.
1-198 Commands and Utilities