Egrep on Solaris

how can I implement

egrep -A 1 "(HI|FR|GO|TAT)" 

in solaris?

Do you have /usr/sfw/bin/ggrep?

2 Likes

yes, but not getting output

Not getting output using /usr/sfw/bin/ggrep -E -A1 ... ?

Can you please show what you have done, including some sample from the file you are searching on?

1 Like

With awk

awk '/(HI|FR|GO|TAT)/ {c=2} (c!=0 && c--!=0)' 
1 Like
/usr/sfw/bin/ggrep -E -A1 ...

is workingworking