awk - find first instance of string after NR==10

How do I use awk to find the NR of first instance of a specific string after eg NR==10?

I need to find the first instance of the word "class" after a specific NR.

awk 'FNR>10 && /class/ {print FNR}' myFile
1 Like

To bail out after the first occurrence of "class", modify vgersh99's {print FNR} to {print FNR; exit} .

Regards,
Alister

2 Likes