Perl

Moderators: Jonathan
Number of threads: 1259
Number of posts: 3644

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:50 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.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.