Finding several patterns and outputting 4 lines after

I an trying to parse a file looking for pattern1, or pattern2, or pattern3 and when found print that line and the next 4 lines after it. I am using korn shell script on AIX and grep -A isn't available.

awk '/pattern1/ || /pattern2/ || /pattern3/{c=5} c-->0' file

or:

awk '/pattern[1-3]/{c=5} c-->0' file
1 Like