Perl

Moderators: Jonathan
Number of threads: 1236
Number of posts: 3605

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help with perl -pi -e inside a perl script Posted by keidrickh on 27 Mar 2012 at 5:47 AM
I have having a issue with escape characters when using the system() command trying to issue Linux OS commands.

CODE:
print "Please enter virtualhost 1 - Example - ucisha.com:";
my $virtualhost1 = <>;

system("ssh -t <HOST> \"sudo su - root -c 'perl -pi -e 's/xmlNamespaceAware=\"false\">/xmlNamespaceAware=\"false\"><Alias>$virtualhost1<\/Alias>/g' /tcserver/springsource-tc-server-node/UCISjvm/conf/krh.xml'\"");

ERROR MESSAGE:
ash: -c: line 0: syntax error near unexpected token `<'
bash: -c: line 0: `sudo su - root -c 'perl -pi -e 's/xmlNamespaceAware=false>/xmlNamespaceAware=false><Alias>kaldj'

Can some please help me out with these escape characters. Thanks in advance.

Thread Tree
keidrickh Help with perl -pi -e inside a perl script on 27 Mar 2012 at 5:47 AM



 

Recent Jobs