[ale] hmm. yer never too old to trip on Grep Reg Expressions

Pete Hardie pete.hardie at gmail.com
Thu Sep 22 19:35:12 EDT 2016


What Leam said - single purpose greps in a pipeline - it's the UNIX way!(tm)


On Thu, Sep 22, 2016 at 7:30 PM, Leam Hall <leamhall at gmail.com> wrote:

> Why not "^def*buff*altplan$"? Then grep v out things you don't want.
>
> On 09/22/16 14:46, Neal Rhodes wrote:
>
>> So, I need to look in about a bazillion source files for variants of
>>
>>     DEFINE BUFFER SNORT FOR ALTPLAN.
>>     Define Buffer Blech for AltPlan.
>>     Def    Buff   Blurf for AltPlan.
>>     Def Buff Blurf for AltPlan.
>>     def buff blurf for altplan.
>>     define buff blurf for altplan.
>>     define                      buffer                   blorf for
>> altplan.
>>     define  new shared buffer                   blorf for altplan.
>>
>> And grap 3 lines before, 10 lines afterwards, source file and  line#.
>>
>> I was thinking this would to it:
>>
>>     grep -i -B 3 -A 10 -H -n -r -f buf-grep.inp * > buf.grep.out
>>
>> Where buf-grep.inp was
>>
>>     def*buff*for*ALTPLAN
>>
>>     def*buff*for*ARM
>>
>>     def*buff*for*ARMNOTE
>>
>> Alas it is not thus, and the more I study the reg exp notes the more I
>> see there error of my ways, and the less I see an expression that would
>> work.
>>
>> Regards,
>>
>>
>> Neal
>>
>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
>> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>



-- 
Pete Hardie
--------
Better Living Through Bitmaps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20160922/2fdae691/attachment.html>


More information about the Ale mailing list