I would like to substitute the values of XML attributes matching a regex in a file in bash.
<Resource name="MailSession" auth="Container" type="javax.mail.Session"
mail.smtp.host="localhost" mail.smtp.user="foo" mail.smtp.passwd="12345678"
mail.pop3.host="localhost" mail.pop3.user="foo" mail.pop3.passwd="12345678"/>
should be transformed to
<Resource name="MailSession" auth="Container" type="javax.mail.Session"
mail.smtp.host="***" mail.smtp.user="foo" mail.smtp.passwd="***"
mail.pop3.host="***" mail.pop3.user="foo" mail.pop3.passwd="***"/>
This should be possible using sed or awk.