Skip to main content
4 of 9
added 27 characters in body

sed lines after match and before next match

how to get all lines after matching word till next different matching word? For example

1 2 3 5 6 

and I need to sed from 1 5 include 1 but not include 5 and bellow but if file contains no 5 it could sed till end of file

Edit:specified question