Hi all,
I have a small problem that I've half solved.
I have 12 files, across 4 servers that I need to edit. I only need to change a single value in them and I thought perl would do nicely.
Here's what I have..
12 files containing the following
$maintenance = 0;
$debug = 0;
$sendMail = 0;
$showErrors = 1;
I need to set $maintenance = 1;
I recently learned about perls "-p" switch that allows you to edit.. so I wanted to use that as such below..
ssh -l webmaster chewbacca "perl -pi -e 's/\$maintenance \= 0\;/\$maintenance \= 1\;/g' /tmp/derek/cgifile.cgi"
where im logging into machine "chewbacca" as webmaster. I'm escaping all of the funny characters with \ and the end result that I see is everything is getting changed to 1, instead of just maintenance. Where did I steer wrong?
I have a small problem that I've half solved.
I have 12 files, across 4 servers that I need to edit. I only need to change a single value in them and I thought perl would do nicely.
Here's what I have..
12 files containing the following
$maintenance = 0;
$debug = 0;
$sendMail = 0;
$showErrors = 1;
I need to set $maintenance = 1;
I recently learned about perls "-p" switch that allows you to edit.. so I wanted to use that as such below..
ssh -l webmaster chewbacca "perl -pi -e 's/\$maintenance \= 0\;/\$maintenance \= 1\;/g' /tmp/derek/cgifile.cgi"
where im logging into machine "chewbacca" as webmaster. I'm escaping all of the funny characters with \ and the end result that I see is everything is getting changed to 1, instead of just maintenance. Where did I steer wrong?