Q:

Output of awk is not shown when used after a grep command

I want to get CPU % of a process using pid from top command in Mac OS. When I use top | awk '{print $3}' I get the CPU % for all the processes. However, using top | grep 11568 | awk '{print $3}' returns nothing. The output of top | grep 11568 is 
11568  java             0.0  09:48.45 663   2   1533+  521M+  0B     741M+  11560 11560 sleeping *0[64+]       0.00000 0.00000    501 1335625+ 803+    12376+    4146+     37032037+  28783+    3748122+   514+    112576  0.0   0      0      amar               N/A    N/A   N/A   N/A   N/A   N/A

A:

Haven't tested this command since I don't have mac os, could you please try following.
your_command | awk -F' +'  '/11568/{print $3}'

