Linux使用GREP,awk删除指定行求助
<url>
<loc>http://www.ucat.cc/index.php?ctl=register</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>http://www.ucat.cc/index.php?ctl=login</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>http://www.ucat.cc/tenders/</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://www.ucat.cc/systemContent/main/1.html</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>http://www.ucat.cc/case/</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://www.ucat.cc/home/</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://www.ucat.cc/javascript:AddFavorite();</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>http://www.ucat.cc/tenders/javascript:AddFavorite();</loc>
<lastmod>2013-11-18</lastmod>
<changefreq>always</changefreq>
<priority>0.7</priority>
</url>
awk -vRS="</url>\n" '!/javascript:/{print $0"</url>"}' index.html > sitemap1.xml.new
sed '/<url>/{:1;N;/<\/url>/!b1;/javascript/d}' index.html > sitemap1.xml.new