[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Three-Line service comments
From: |
Mark . Burgess |
Subject: |
Re: Three-Line service comments |
Date: |
Thu, 2 Aug 2001 08:28:51 +0200 (MET DST) |
On 2 Aug, Adrian Phillips wrote:
>>>>>> "Tim" == Tim Auckland <Tim.Auckland@procket.com> writes:
>
> [Note, cfengine newbie]
>
> Tim> A common format for labeling services in, eg, inetd.conf is
> Tim> to add a comment group just before the service.
>
> Tim> For example:
>
> Tim> # # GNATS # support stream tcp nowait gnats
> Tim> /usr/libexec/gnats/gnatsd gnatsd
> One possibly way to solve this in cfengine would be a way to specify
> the newline as one can with perl, then any regexps could be made to
> work on several lines at a time, e.g. :-
>
> NewLine 0777
> ReplaceAll "(#.*\n)*support stream.*\n" With ""
>
> (Perhaps this works already ?)
>
> Sincerely,
>
> Adrian Phillips
>
See:
http://www.cfengine.org/docs/cfengine-Tutorial.html#Variable%20substitution
you can use $(n) as a newline or $(cr) for carriage return. That way you
could just search and replace the commented line for a four line stanza.
cheers,
Mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: Mark.Burgess@iu.hio.no
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~