Re: [CentOS] [OT] Grep Patterns

2010-04-08 Thread Slack-Moehrle
Hi Les, >White space could be a tab. '[[:space:]]CP_' should work, but why not use sed >and be done with it. ah, worked!. I was thinking way to much into this. I thought that I had to ignore what I didn't want, but in thie case what I dont want does not have a space so it would not show up an

Re: [CentOS] [OT] Grep Patterns

2010-04-07 Thread Joseph L. Casale
>White space could be a tab. '[[:space:]]CP_' should work, but why not use sed >and be done with it. Yup, you got me on that oversight:) What app are you using Jason? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/c

Re: [CentOS] [OT] Grep Patterns

2010-04-07 Thread Les Mikesell
Joseph L. Casale wrote: >> Yes whitespace always. > > [r...@dev ~]# echo " CP_" | egrep -e "\ CP_" > CP_ > [r...@dev ~]# echo "CPLAT::CP_" | egrep -e "\ CP_" > [r...@dev ~]# > >> So what I am doing is a massive replace. So this grep will allow me to see >> how many instances still need to be re

Re: [CentOS] [OT] Grep Patterns

2010-04-07 Thread Stephen Harris
On Wed, Apr 07, 2010 at 04:04:53PM -0700, Slack-Moehrle wrote: > Yes whitespace always. [..] > I am replacing CP_ with CPLAT::CP_ and when i execute the grep I want Well, be clear. Are you replace "CP_" or " CP_". If the latter then it's a LOT easier; just search for " CP_" (grep ' CP_'). I

Re: [CentOS] [OT] Grep Patterns

2010-04-07 Thread Joseph L. Casale
>Yes whitespace always. [r...@dev ~]# echo " CP_" | egrep -e "\ CP_" CP_ [r...@dev ~]# echo "CPLAT::CP_" | egrep -e "\ CP_" [r...@dev ~]# >So what I am doing is a massive replace. So this grep will allow me to see how >many instances still need to be replaced. > >I am replacing CP_ with CPLAT::

Re: [CentOS] [OT] Grep Patterns

2010-04-07 Thread Slack-Moehrle
Hi, >>How would I write I want to find 'CP_', but NOT instances of 'CPLAT::CP_'? >What comes before 'CP_' when you want a match? Whitespace, other chars, is it >just 'CPLAT::CP_' you don't want? Yes whitespace always. So what I am doing is a massive replace. So this grep will allow me to see h

Re: [CentOS] [OT] Grep Patterns

2010-04-07 Thread Joseph L. Casale
>How would I write I want to find 'CP_', but NOT instances of 'CPLAT::CP_'? What comes before 'CP_' when you want a match? Whitespace, other chars, is it just 'CPLAT::CP_' you don't want? Anchor the search on that criteria, like a negated group before the 'CP_' or at least one of 'whitespace' for

[CentOS] [OT] Grep Patterns

2010-04-07 Thread Slack-Moehrle
Hi All, One of the text editors I use offers one to specify a grep pattern to do a multi-file search and I am not wrapping my head around proper RE patterns to accomplish using this. There are so many rules! Can anyone help with a specific example so I can try to understand better? How would