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" {} \;

Comments

Leave a Reply