Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] grep question

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 ?


"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
speaking to the Hispanic Chamber of Commerce

Attachment: signature.asc
Description: Digital signature