[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use regex in editfiles?
From: |
Frank Smith |
Subject: |
Re: How to use regex in editfiles? |
Date: |
Sun, 29 Aug 2004 00:47:50 -0500 |
--On Saturday, August 28, 2004 11:29:48 +0200 Josef Wolf <jw@raven.inka.de>
wrote:
> Hello!
>
> I try to use regular expressions to edit files. I put the following in
> the editfiles section:
>
> { /etc/services
> SetLine "cfengine 5308/tcp"
> AppendIfNoLineMatching "cfengine[:blank:]+5308/tcp"
> }
>
> But the regexp does not match so that the line is added every time cfagent
> is run.
>
> Any idea what I'm doing wrong here?
Try this instead:
AppendIfNoLineMatching "cfengine[[:blank:]]5308/tcp.*"
which should also match lines with trailing spaces and/or comments.
Frank
>
> --
> Please visit and sign and http://www.ffii.org
> -- Josef Wolf -- jw@raven.inka.de --
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine