|
BASH - finding and coloring a whole line
I'm writing a shell script to check my nightly backup logs. I want to find a line and high light the line. the sed command works but I want it to include the variable text on both sides of the found text.
cat temp1_log | sed $'s/Total number of bytes transferred/\e[1m&\e[0m/'
output example:
12/10/12 21:28:03 Total number of objects expired: 30
12/10/12 21:28:03 Total number of objects failed: 0
12/10/12 21:28:03 Total number of bytes inspected: 29.23 GB
12/10/12 21:28:03 Total number of bytes transferred: 17.63 GB
12/10/12 21:28:03 Data transfer time: 680.32 sec
12/10/12 21:28:03 Network data transfer rate: 27,181.52 KB/sec
as always any help would be greatly appreciated.
|