In ed
one can delete a line number by typing its address followed by the delete
command, as in 1d
. To delete a range of lines, one uses the comma, as in 1,4d
. One can also delete lines with specific content as in g/Ted/d
. Is there a way to specify the deletion of non-sequential lines in a single command? I.e. let's say I wanted to delete lines 1 and 3 and 8 at one time without typing:
1d
3d
8d