最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

shell - XML replace value into tags - Stack Overflow

programmeradmin1浏览0评论

I using sed for replace xml values. If value had "/" in it (I mean for example URL address) replace failed:

-> Extracting the value from the element:

ext_value=grep "<$2>.*<" $1 | sed -e "s/^.*<$2/<$2/" | cut -f2 -d">"| cut -f1 -d"<"

login_page oa_var="s_login_page" this is $2 parameter

sed -e "s/<$2>$ext_value</<$2>$3</g" $1 > $temp_file

$3 my desired value (also with slash)

Please advise how I can avoid this.

Thanks for all.

发布评论

评论列表(0)

  1. 暂无评论