Hi Pat,
On Tue, Dec 4, 2012 at 3:28 PM, Pat Riehecky <[email protected]> wrote: > Hello, > > I'm trying to put a comment in right above a line before I change it. I'm > going to be performing some edits on systems I do not administer. Leaving > behind reasons why some things were changed should help explain things for > the real administrators in the future. > > In particular I've tried: > > ins 99999 before /files/etc/httpd/conf/httpd.**conf/*[arg =~ > regexp('["]*/var/www/html["]*'**)]/*[arg = 'Indexes'] > set /files/etc/httpd/conf/httpd.**conf/99999 "# removed Indexes from > Options" > > but that does not seem to be right. > > Indeed. Comments are mapped as #comment nodes, not seq nodes. Your node needs to be named "#comment", with a value of "removed Indexes from Options" (without a leading spaces, they are removed by Augeas), so something like: ins #comment before /files/etc/httpd/conf/httpd.conf/*[arg =~ regexp('["]*/var/www/html["]*')]/*[arg = 'Indexes'] set /files/etc/httpd/conf/httpd.conf/#comment[.=""] "removed Indexes from Options" Note that this is not idempotent though: if you run it several times, you will get several comment nodes. The easiest way to make it idempotent would be to add an rm before the ins, to ensure only one comment with value "removed Indexes from Options" is present. Raphaël
_______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
