$ sed '/b/,~8 d' a-i.txt
I know what it does. But, they say "a multiple of 8" for ~8. Why is it expressed as "a multiple of 8"?
$ sed '/b/,~8 d' a-i.txt
I know what it does. But, they say "a multiple of 8" for ~8. Why is it expressed as "a multiple of 8"?
/b/,~8
matches lines starting with a line containingb
and continuing until a line is reached whose line number is a multiple of 8From
man sed
:Examples
This prints any line which contains
5
and all following lines up to and including the next line whose line number is a multiple of 8:This prints from a line containing 14 to the next line whose line number is a multiple of 8:
This deletes all lines starting with a line matches
5
and ending with the next line whose line number is a multiple of 8:Similar but different
This prints the fourth line and every eigtht line thereafter:
This prints a line matching
4
and the next three lines which follow: