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" {} \;
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment