Author: arkurth
Date: Mon Feb 25 19:05:28 2013
New Revision: 1449816
URL: http://svn.apache.org/r1449816
Log:
VCL-676
Fixed command in OS.pm::remove_lines_from_file. Changed single quotes to
doubles and escaped them.
Modified:
vcl/trunk/managementnode/lib/VCL/Module/OS.pm
Modified: vcl/trunk/managementnode/lib/VCL/Module/OS.pm
URL:
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/OS.pm?rev=1449816&r1=1449815&r2=1449816&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS.pm Mon Feb 25 19:05:28 2013
@@ -1954,7 +1954,7 @@ sub remove_lines_from_file {
# Assemble the command, grep the pattern to retrieve the number of
times the pattern exists in the file before and after
# This is used to verify that the pattern doesn't exist afterwards
- my $command = "echo -n 'before:' ; grep -c '$pattern' $file_path 2>&1 ;
sed -i -e '/$pattern/d' $file_path 2>&1 ; echo -n 'after:' ; grep -c '$pattern'
$file_path 2>&1";
+ my $command = "echo -n \"before:\" ; grep -c \"$pattern\" $file_path
2>&1 ; sed -i -e \"/$pattern/d\" $file_path 2>&1 ; echo -n \"after:\" ; grep -c
\"$pattern\" $file_path 2>&1";
my ($exit_status, $output) = $self->execute($command, 0);
if (!defined($output)) {
notify($ERRORS{'WARNING'}, 0, "failed to execute command to
remove lines containing '$pattern' from '$file_path' on
$computer_short_name\ncommand: $command");