I am on AIX system. But grep on AIX does not support -B, -A, -M on AIX system. Are there other solutions like awk or sed which can do the same job?
For example:
str1
str2
str3
str4
str9
str8
str1
str3
str2
I try to run grep str3 -m 1 -B 1 -A 1 to get:
str2
str3
str4
but it does not work on AIX. Is there any solution for sed or awk?
1 Answer