I know this question has the answer to getting 5 lines after pattern. I am trying my own method with this command:
awk 'BEGIN{count=0} { /pattern/{count=5;next}; if(count>0){print; --count;} }' inputFile
but this gives me syntax error.
I know this question has the answer to getting 5 lines after pattern. I am trying my own method with this command:
awk 'BEGIN{count=0} { /pattern/{count=5;next}; if(count>0){print; --count;} }' inputFile
but this gives me syntax error.