由买买提看人间百态

topics

全部话题 - 话题: findkey1
(共0页)
t*******y
发帖数: 81
1
awk 'BEGIN{findkey1=0;}
{if ($0 ~ /keyword1/){findkey1=1;}
if(findkey1=1){print;}
if($0 ~ /keyword2/){findkey1=0;}
}' input-file
it should all be on the same line.
not sure about the actual syntax since I don't have
a reference book at hand, but you get the idea.
(共0页)