Bash extract between two strings using sed

Extract between a start and an end string using sed.

The following will extract content between html comments in markdown (.md) files:

start='<!--'
end='-->'
find . -type "f" -name "*.md" -exec sed -n "/${start}/,/${end}/p" {} \;
If you liked this posting, please feel free to leave me a comment below.
View this page on GitHub.
Posted .

Comments

Leave a Reply