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" {} \;
View this page on GitHub.
Posted .

Comments

Leave a Reply