Sample Header Ad - 728x90

Deleting specific line numbers in ed in a single command

2 votes
1 answer
336 views
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
Asked by edman (588 rep)
Jun 24, 2022, 05:08 PM
Last activity: May 3, 2024, 02:56 PM