I'm writing a bash script to streamline an installation.
I want to replace the old database settings in an xml file with a new value. But I don't manage to get it right
original string: url="jdbc:oracle:thin:@localhost:1521:xe"
script:
read -e -p "Enter the ORACLE SID: " -i "orcl" ORACLE_SID_VALUE
sed -i '/url="jdbc:oracle:thin:@localhost:1521:xe"/c\url="jdbc:oracle:thin:@localhost:1521:$ORACLE_SID_VALUE"' /home/server/tomcat/conf/Catalina/localhost/server.xml
result in xml file: url="jdbc:oracle:thin:@localhost:1521:$ORACLE_SID_VALUE"
Can anyone help me?
No comments:
Post a Comment