Title: Reading Unix's top command

Hi,

In order to get an email advising me that a process is using too much %cpu, i wanted to be able to redirect the output of the Unix top command into a text file, then use regular expressions to get the data i need.

However, redirecting top's output into a file, ends up being one long line with a lot of  control-M characters and other funny characters like these:

1 running^M^[[BCpu states:^M^[[BCPU

Is there a way to parse the file, as you would go through a normal text file.

Thanks

Kareem Galal
Unix Systems Administrator
Financial Network Services. 
+61 2 9310 9895


Reply via email to