Displaying 1 result from an estimated 1 matches for "prepend_if_no_such_line".
2007 Aug 20
1
SimpleTextRecipes
...if_no_such_line($file, $line) {
exec { "echo ''$line'' >> ''$file''":
unless => "grep -qe ''$line'' -- file",
path => "/bin:/usr/bin:/usr/local/bin",
}
}
define prepend_if_no_such_line($file, $line) {
exec { "/usr/bin/perl -p0i -e ''s/^/$line\n/;'' ''$file''":
unless => "grep -Fxqe ''$line'' ''file''",
path => "/bin:/usr/bin:/usr/local/bin",...