[Novalug] need grep help

James Ewing Cottrell 3rd JECottrell3@Comcast.NET
Fri Mar 16 17:33:31 EDT 2012


The reason you added it was because you needed to in order to combine 
the two REs.

I know...I kinda hate those all comment config files, but you can also 
sort -r them in case the order doesn't matter.

Heck, I used to sort sendmail config files to scan the major 
parts...clearly the rulesets are messed up, but I would be looking at 
defines, options, mailers when I did that.

JIM

On 3/16/2012 4:06 PM, Kevin Cole wrote:
>
>
> On Fri, Mar 16, 2012 at 16:12, James Ewing Cottrell 3rd 
> <JECottrell3@comcast.net <mailto:JECottrell3@comcast.net>> wrote:
>
>     Cleverness Kudos for combining the two RE's into one, but
>     Performance Dings for not keeping them separare.
>
>     For all comments, the ".*" part will have to be scanned unnecessarily.
>
>
> Woopsie... Now you've got me wondering what made me add it.
>
>     I still say that '^$|[ \t]#' is better, and more clear.
>
>
> Only a programmer would find \t clearer than :space: ;-)
>
>     Besides...what happens when you want to add other types of
>     comments? Bind files use ';'. C++ and others use '//'.
>
>
> That thought has occurred, but 99% of my use case has been config 
> files that use #  where the ratio of real commments and deactivated 
> options to active lines is about 500 to 1, and python code.   Well, 
> maybe 85%, as see a fair amount of HTML / CSS / PHP / Javascript / SQL 
> comments.  Still, my main need has been filtering those config files 
> that are really documentation with a few live examples in them.
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20120316/85a14152/attachment.htm>


More information about the Novalug mailing list