The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 03-17-2009
sky_rivers sky_rivers is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 4
I tried
Code:
's!\(<meta.*\).$!\1 />!'

with find like this

Code:
find . -name "*.html" -print0 | xargs -0 sed -i 's!\(<meta.*\).$!\1 />!'

It works,but the result contains two ">" like this...
HTML Code:
<meta name="keywords" content="keyword1, keyword2"> />
i could run another sed to replace "> />", but if it is a easy improvement in the find section above?

I played with JCastro's example, but could not get it to work with find piped to sed

I am close and have enough to play further, but any further assistance would be great.