UNIX sed

I'd like to replace the word "Failed" in <TD>Failed</TD> with <TD><p style="background-color:red;">Failed</p></TD>

I used sed -e 's/Failed/<p style="background-color:red;">Failed<\/p>/
but it was errored out.
Please help.  Thanks.

Besides, can "sed" ignore the case?
scpigAsked:
Who is Participating?
 
PapertripConnect With a Mentor Commented:
sed -e 's/Failed/\<p\ style=\"background-color:red\;\"\>Failed\<\/p\>/' filename

Open in new window

0
 
scpigAuthor Commented:
Thanks. This works.  
But how do I ignore case (-i) in this sed?  The word could be "Failed", "failed", or "FAILED".
0
 
PapertripCommented:
sed -e 's/Failed/\<p\ style=\"background-color:red\;\"\>Failed\<\/p\>/i' filename

Open in new window

0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
scpigAuthor Commented:
works good.  Thank you.
0
 
TintinCommented:
No need for the leaning toothpick syndrome ;-)


sed  's#Failed#<p style="background-color:red;">Failed</p>#i' filename

Open in new window

0
 
PapertripCommented:
Learn something new every day, thanks Tintin.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.