[Novalug] need grep help
jbholland at gmail.com
Thu Mar 15 19:54:38 EDT 2012
from a search:
*egrep -v "^[[:space:]]*$|^#"
but I would say change it to:
*cat filename | egrep -v "^[[:space:]]*$|^**[[:space:]]***#" *| less
seems to work for me........
On 3/15/12 7:44 PM, Jay Hart wrote:
> I like to search config files with the comment lines removed. So I thought
> more filename | grep -v "#"
> would remove any line starting with a "#" character
> However it seems to actually remove any line with a "#" on the line,
> regardless of placement (or something similar to this behavior).
> I've seen some examples online to remove lines if the first char is a #, but
> not for example if the line is indented, but still a comment.
> What I'm really looking for is a grep that will remove all comment lines, or
> lines that are blank.
> grep -v '^$' filename |grep -v "#"
> doesn't quite get me there.
> Can I get some pointers on this.
> Novalug mailing list
> Novalug at calypso.tux.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Novalug