Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am trying to grep for the text matches of the following in our source codes.
ADD CBP
ADD CBV
WRITE CBP
WRITE CBVThe source components may end with *.bv or *.cpy or *.mac. I used find and egrep, but I am not able to search the above patterns. This is the command I used.
find /met /page \( -name '*.bv' -o -name '*.cpy' -o -name '*.mac' \) -exec egrep -il '(ADD|WRITE CB[PV])' {} \; 2>/dev/null
But the above command doesn't work unless I remove the CB[PV]. However I need to search for ADD CBP, ADD CBV, WRITE CBP and WRITE CBV.
Can some one help me how to acheive this?
Thanks,
Balaji.

Never mind. I figured out the solution which is given below.
find /met/le \( -name '*.bv' -o -name '*.cpy' -o -name '*.mac' \) -exec egrep -i '(ADD|WRITE)(CBP|CBV)' {} \; 2>/dev/null
Thanks,Balaji.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |