You can use sed
to trivially select text between two matching lines, but this will also include the corresponding lines ... so we will explicitly delete them:
sed -n '/System_Power/,/System_Terminate/ { /^\*/ d p }' < input
Awk can also select text between the corresponding lines:
awk '/System_Power/,/System_Terminate/ {print}' < input
... but, like sed
, this will include the terminators of the beginning and the end. You can fix this with awk
, but I think you will get a cleaner solution with sed
.
source share