I run a crontab every 30 minutes to with "ps auwwg >psfile.out"
I want to take the PID field and conevert that to column headers, then have the proper information fall under it for every 30 minutes.
example of date & ps auwwg
----
24aug050200
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME cmd
root 4468 0.0 0.0 16 8892 - A Aug 03 0:00 kproc
root 4682 0.0 0.0 460 204 - A Aug 03 0:00 /usr/sbin/syslogd
root 4988 0.0 0.0 496 236 - A Aug 03 0:00 /usr/sbin/srcmstr
root 5174 0.0 0.0 72 24 - A Aug 03 0:00 /usr/ccs/bin/shlap
----
The result should look like this:
---
pid--> 4468 4682 4988 5174
date sz;rss sz;rss sz;rss sz;rss
24aug050200 16;8892 460;204 496;236 72;24
24aug050230 16;8892 460;204 496;836 72;44
24aug050300 16;8892 460;204 496;936 72;54
24aug050330 16;8892 460;204 496;636 82;64
How do I do this with awk or sed?
I want to take the PID field and conevert that to column headers, then have the proper information fall under it for every 30 minutes.
example of date & ps auwwg
----
24aug050200
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME cmd
root 4468 0.0 0.0 16 8892 - A Aug 03 0:00 kproc
root 4682 0.0 0.0 460 204 - A Aug 03 0:00 /usr/sbin/syslogd
root 4988 0.0 0.0 496 236 - A Aug 03 0:00 /usr/sbin/srcmstr
root 5174 0.0 0.0 72 24 - A Aug 03 0:00 /usr/ccs/bin/shlap
----
The result should look like this:
---
pid--> 4468 4682 4988 5174
date sz;rss sz;rss sz;rss sz;rss
24aug050200 16;8892 460;204 496;236 72;24
24aug050230 16;8892 460;204 496;836 72;44
24aug050300 16;8892 460;204 496;936 72;54
24aug050330 16;8892 460;204 496;636 82;64
How do I do this with awk or sed?