OpenVZ Forum


Home » General » Support » Need help with a exec command (error using exec command)
Need help with a exec command [message #42232] Tue, 22 March 2011 15:28
B3rt is currently offline  B3rt
Messages: 2
Registered: July 2009
Junior Member
I want to execute a perl commando using the exec command but I cannot get the syntax correct.

vzctl exec 12345 "/usr/bin/perl \-pi\~ \-e \'\$\_=\"servername=my.hostname.here\\n\" if /\^servername=/\' /usr/local/directadmin/conf/directadmin.conf" 


When i execute the above commando i get the following error:
Can't find string terminator "'" anywhere before EOF at -e line 1.

I tried several options and combinations but i cannot get it correct, it keeps giving an error.

The following command works within the VZ container itself:
 /usr/bin/perl -pi~ -e '$_="servername=my.hostname.here\n" if /^servername=/' /usr/local/directadmin/conf/directadmin.conf

So this command should be executed from the hardware node (outside the VZ container) using the vzctl exec command.

Can someone see the error here?
Thx for any help.
 
Read Message
Previous Topic: OpenVZ Containers over ZFS
Next Topic: Slow start when VE have lots of IPs
Goto Forum:
  


Current Time: Sun Aug 18 13:19:10 GMT 2024

Total time taken to generate the page: 0.02865 seconds