Search Results

Search: Posts Made By: sky_rivers
4,727
Posted By sky_rivers
The following uses regular expression to remove...
The following uses regular expression to remove any unlisted characters (including ">") and seems to be more predictable.
find . -name "*.html" -print0 | xargs -0 sed -i s/\(<meta name[a-zA-Z...
4,727
Posted By sky_rivers
This works... find lib/lib-pal -name "*.html"...
This works...
find lib/lib-pal -name "*.html" -print0 | xargs -0 sed -i 's!\(<meta.*\).$!\1 />!;s/"> \/>/" \/>/g'

Thanks
4,727
Posted By sky_rivers
I tried 's!\(<meta.*\).$!\1 />!' with find like...
I tried 's!\(<meta.*\).$!\1 />!' with find like this
find . -name "*.html" -print0 | xargs -0 sed -i 's!\(<meta.*\).$!\1 />!'

It works,but the result contains two ">" like this...
<meta...
4,727
Posted By sky_rivers
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 <meta name="keywords" content="kayword 1, kwyword2">

and should be <meta name="keywords"...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 09:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy