tomcat - sed command is not working in userdata of ubuntu ec2 -


i want replace line in apache-tomcat-7.0.50/conf/server.xml via template in ubuntu ec2 instance.i used following command not working.

#!/bin/sh -v /usr/bin/apt-get update -y /usr/bin/apt-get upgrade -y sed -i 's/proxyname=.*/proxyname=elburl proxyport=\"80\"\/>/' /home/ubuntu/apache-tomcat-7.0.50/conf/server.xml service tomcat restart 

but able run sed command in command prompt.

thanks in advance

sed -i 's#proxyname=.*/proxyname=elburl proxyport=\"80\"\#>#' /home/ubuntu/apache-tomcat-7.0.50/conf/server.xml

use (here use #) separator default / because use inside pattern (or escape in pattern)


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -