[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Newbie Question regarding commenting out all the lines without hash
From: |
Paul Paradise |
Subject: |
Re: Newbie Question regarding commenting out all the lines without hash marks |
Date: |
Wed, 26 Jun 2002 16:28:28 -0700 |
User-agent: |
Mutt/1.3.28i |
On Wed, Jun 26, 2002 at 08:01:10AM +0200, Mark.Burgess@iu.hio.no wrote:
> > editfiles:
> > { /etc/inetd.conf
> > HashCommentLinesMatching "^[^#]"
> > }
> >
> > But this doesn't seem to do anything. Running an egrep "^[^#]"
> > /etc/inetd.conf seems to work. I'm using the latest cfengine,
> > 2.0.3.
>
> Your regexp matches only two characters, you need to write
>
> HashCommentLinesMatching "^[^#].*"
It seems to me that if I wanted to match a line with just a character
other than a hash at the beginning I would write "^[^#]$", not
"^[^#]". In general, shouldn't a regex assume .* at the beginning and
end of a particular pattern match unless it is specifically bound with
a "^" or "$"?
--
----------------------------------------------------------------------
Paul Paradise paradise@qualcomm.com
Interim Engineering Intern, QUALCOMM Incorporated 858.651.6655
IT Host Services AE-205C
----------------------------------------------------------------------