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 -->
  #1 (permalink)  
Old 03-17-2009
sky_rivers sky_rivers is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 4
sed pattern matching or passing variables

I need sed to add a "/>" to the end of a line that contains/starts with <meta.

current line is
HTML Code:
<meta name="keywords" content="kayword 1, kwyword2">
and should be
HTML Code:
<meta name="keywords" content="kayword 1, kwyword2 " />

i need something like this?
Code:
find . -name "*.html" -print0 | xargs -0 sed -i 's/<meta *>/<meta * \/>/g'
any help would be appreciated