====== SED - Print - Print paragraph if it contains string ====== Print paragraph if it contains AAA (blank lines separate paragraphs) sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;' **NOTE:** HHsed v1.5 must insert a 'G;' after 'x;'
sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;'