Microsoft
Software
Hardware
Network
Question : Only the search string needs to be in color + awk.
The actual search expression is:
awk '/exception/ {i=1 ; while(i<=6) {print getline; i++} }' detail.log
I modified it to show the string exception to be in some color. Obviously, this is not correct all the lines are shown in color and also at the end of each line I see ;1.
I want only search string to be in color like grep --color=auto 'exception' detail.log. How do I do that?
awk '/exception/ {i=1 ; while(i<=6) {print "\033[1;34m" $0 "\033[0;00m;" getline; i++} }' detail.log
Answer : Only the search string needs to be in color + awk.
Why don't you use grep itself??
(-A tells grep to print 5 lines after the context is found)
1:
grep -A5 "exception" detail.log
Random Solutions
How do I make Firefox prompt me for an application to open XML files?
Can't access Microsoft windows update website anymore?
Corrupt Windows\System32\Config\Sy
stem
Documentation on SAMBA and Active Directory Integration
Cannot Access Drive
using ubuntu 10.4 to format a drive for apple OS ?
importing to firefox
SQL 2005 on a windows 2003 cluster , how to back up
vbscript exit if file exists
How to alter web page so Google Chrome will clear old data?