Hi,
I am an amateur bash scriptwriter and I need to write a script which creates a report in a formatted, easy to read table-like that is displayed to standard output. The script has to export the followings: Process ID,User Name, Command Name,Priority.....
Now I have a file that I can see all the report as a text, separated by comma like this:
1,root,init,20,0.0,0.1,0:01.78
1008,root,migration/0,1,2.0,1.8,7:04.32
5,root,watchdog/0,1,0.0,0.0,0:00.00
I need to have (-u option) which gives me a user specified by regex like this: myscript -u mytxt.top
This has to give me: The user name,The process name,The process ID,% of CPU Time,% of Memory
The output has to be like this:
I know that I have to use AWK or SED to get the total of CPU and other stuff... however I am not that comfortable to write this...
any help would be appreciated.
Thanks
---------- Post updated at 11:54 PM ---------- Previous update was at 09:05 PM ----------
great! no solution?!