Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

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?
0
scpig
Asked:
scpig
  • 3
  • 2
1 Solution
 
PapertripCommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now