Folks, I am not a programmer - wish that I were at this point. Regexes are the bane of my existence right now.
I am attempting to update /etc/rc.d/init.d/functions on CentOS and RH linux boxes with the .cf-before-edit extension. In this way, start-up scripts like /etc/rc.d/init.d/networks will ignore files with this extension and NOT consider them valid interface configuration files. Here's the pertinent excerpt of the file to be modified: 1 is_ignored_file() { 2 case "$1" in 3 *~ | *.bak | *.orig | *.rpmnew | *.rpmorig | *.rpmsave) 4 return 0 5 ;; 6 esac 7 return 1 8 } 9 __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' Using a very simple pattern (probably too simple, see below) and a replacement works for line 3 . It's line 9 I'm having trouble with. I haven't been able to get anything to match for it. What I want to do is add \.cf-before-edit to the end of the string - but I don't seem to be able to make a match for a replacement. Could someone help understand how I might put this in the expression of line 9? Thanks, deb Working code for line 3: bundle agent test { files: "/tmp/fun" comment => "Add .cf-before-edit to the list of ignore files functions", edit_line => tmp_fun; } bundle edit_line tmp_fun { replace_patterns: "(\.rpmsave\))" replace_with => value(".rpmsave | *.cf-before-edit)"); } _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine