|
From: | Sven Mueller |
Subject: | Re: editfiles question |
Date: | Wed, 01 Sep 2004 17:00:26 +0200 |
User-agent: | Thunderbird 0.7.3 (Windows/20040803) |
Ed Brown [u] wrote on 01/09/2004 16:44:
Here's another approach: editfiles: { /etc/whatever BeginGroupIfNoLineMatching "root:$1raboof:4875::::::" LocateLineMatching "^root:.*" ReplaceLineWith "root:$1raboof:4875::::::" EndGroup }
Wouldn't that approach replace some other line if no line matching "^root:.*" was found while no line matching "root:$1raboof:4875::::::" existed before? Hmm, no, according to the documentation, if LocateLineMatching doesn't find a match, it aborts any further editing. So your approach will only replace existing lines, but if none matching "root:.*" is found, it won't do anything.
cu, sven
[Prev in Thread] | Current Thread | [Next in Thread] |