I am trying to replace password value with in a xml file with a new value stored in MyFile, can someone please let me know the ways through achieve this.Thanks
MyFile=test123
<Resource accessToUnderlyingConnectionAllowed="true" auth="Container" driverClassName="com.ibm.db2.jcc.DB2Driver" factory="com..tomcat.jndi.JSCommonsBasicDataSourceFactory" maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/server" password="myPassword"/>
Below error shown after executing the below command, please advise.
xmlstarlet ed --omit-decl --inplace \ --update '//Resource/@password' --value "testingfile" \ /apps/META-INF/context.xml
failed to load external entity " --update"
xmlstarlet ed --omit-decl --inplace --update '//Resource/@password' --value 'testingfile' /apps/META-INF/context.xml
/apps/META-INF/context.xml:26.119: AttValue: " or ' expected maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/server" password= ^ /apps/META-INF/context.xml:26.119: attributes construct error maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/server" password= ^ /apps/META-INF/context.xml:26.119: Couldn't find end of Start Tag Resource line 26 maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/server" password= ^
<
; 2. you can't use curly quotes, stick to plain double quotes. – glenn jackman