Unanswered: The AB of grep
Did not know that yet. Has been around for quite some time:
on Linux you can specify the uppercase A and B parameters to grep. This stands for Before & After and lets you specify how many lines must be displayed extra besides the 'hit'. For us this could be extremly usefull when we're analysing db2diag files or big snapshots.
Example: I want to see if and how frequent I get certain error messages
This will display all complete section containing this 'DIA3603E SSL bla bla bla' messages.
cat db2diag.log | grep -i dia3603 -B6 -A1
I tried it on AIX as well but that grep-version is too old and does not support those fancy options
On windows I tried it with the bash/grep which is included in the mobaXterm product and that works as well
Somewhere between " too small" and " too large" lies the size that is just right.
- Scott Hayes