Valued Contributor Valued Contributor
Re: Grep in AWK
I do something pretty simple.

if I am looking for a particular string in a field, I do the following.

This example looks at output from ONSTAT and prints output. In this example I filter out data prior to running it against AWK as it reduces processing time by doing so.


onstat -u |grep -v informix|grep -v total |awk '{print $9, $4, $5, $10, $11}' |sort -n |tail -10