User Tools

Site Tools


sed:print:print_paragraph_if_it_contains_string1_or_string2_or_string3

SED - Print - Print paragraph if it contains string1 or string 2 or string3

Print paragraph if it contains AAA or BBB or CCC.

sed -e '/./{H;$!d;}' -e 'x;/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d
gsed '/./{H;$!d;};x;/AAA\|BBB\|CCC/b;d'         # GNU sed only

NOTE: HHsed v1.5 must insert a 'G;' after 'x;'

sed/print/print_paragraph_if_it_contains_string1_or_string2_or_string3.txt · Last modified: 2020/08/16 13:02 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki