On Sun, Apr 13, 2008 at 08:39:17AM +1000, Alex Samad wrote:
> Hi
> 
> 
> I want to look at a config file that uses ; as comments, but I want to
> look at everything that is not a commented line
> 
> so I tried grep -v '^\W*;' which sort of works, except it leaves me with
> blank lines now, how can I not show the blank lines
> 
adding to this I tried it in perl

perl -nle 'print "[$_]" if ( ! m/^\s*;/)' sip.conf 

but it still prints out blank lines where it matches ?


(i realised  i used \W instead of \s before)

another question while we are on regex, how do I use [:space:] in grep
and perl ?

Alex

-- 
"A lot of times in the rhetoric, people forget the facts. And the facts are 
that thousands of small businesses -- Hispanically owned or otherwise -- pay 
taxes at the highest marginal rate."

        - George W. Bush
03/19/2001
speaking to the Hispanic Chamber of Commerce

Attachment: signature.asc
Description: Digital signature

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to