mercredi 30 septembre 2015

sed command not working on aws template

i have a sed command i want to run on a file. the command adds a couple of lines in front of a string.

this is the sed command i want to run: sed -i "/</VirtualHost>/i\ SSLCertificateFile /etc/httpd/cert/aws.cer \nSSLCertificateKeyFile /etc/httpd/cert/aws.key" ssl.conf

the Json entry in the cloud-formation template User Date is :

"sed -i '/<\/VirtualHost>/i \ \nSSLCertificateFile /etc/httpd/cert/aws.cer \nSSLCertificateKeyFile /etc/httpd/cert/aws.key' /etc/httpd/conf.d/ssl.conf \n",

but im getting the following error:

sed: -e expression #1, char 23: unknown command: `S'

can some please help me fix the json expression

thanks




Aucun commentaire:

Enregistrer un commentaire