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
subquery returned more than 1 value: database vendor code 512
Microsoft Access Database Engine 2010 Redistributable and "OpenRowSet"
Delivery not authorized, message refused. 550-5.7.1 Message targeted to organization's federated delivery mailbox.
Zebra LP 2844 label printer prints the first print job successfully, subsequent print jobs after skip labels and/or print partial data on labels until computer is rebooted.
breadcrumb trail in a dropdown box
IIS 6.0 asp.net 2.0 cpu performance issue
HP 1320 Pinter smudges
Download manager Flashget V3.3 disabled IE & Firefox browsers from browsing Internet
Reset display resolution windows 7
File permissions