I'm trying to figure out what the CPU usage of Firefox is at any given moment in time, and pipe that number to another script.
So, top is not the answer, since its output is in a chart and polluted with special characters.
I've also tried:
ps -eo pid,cp | grep $(pidof firefox)
But that gives CPU usage divided by CPU time, which is not the same that top or Gkrellm report.
So, how can I write a one-liner that gets the CPU usage of a particular PID?