Q:

grep first occurence for many matches

Just use flag -m to define number of occurrences to match:
grep -m1 pattern file
0

New to Communities?

Join the community