I have the following content in a file: These are just some timestamps
455860902
868790949
279116188
689905426
example - I would like following output
###########
sed -n '/455860902/,/868790949/p' file
sed -n '/868790949/,/279116188/p' file
sed -n '/279116188/,/689905426/p' file
It needs to go through a loop to save me from typing out the sedcommand each time.
sedcommands? The commands that you output seems to output the lines of the file in pairs. If you want to use the lines offilein pairs somewhere, there may be much more efficient ways to do this. For example by reading the output ofpaste <(sed '$d' file) <(sed '1d' file)or just keeping track of the previous line and using that with the current line in a loop.sedcommands as thesedcommands themselves are doing.tail -n +2(no need for theseds)?