appending a time stamp to prstat
Hi,
I am trying to run prstat for an extended time, outputting to a file and appending a time-stamp to each line (running on Solaris 10). I have tried this:
prstat -c -U usrname 60 480 | nawk '$1=="PID" { "date +%d%m%Y-%H:%M:%S" | getline d ; close("date") } { print d,$0 }' > /tmp/fileName &
this only appends the time the command was started to each line. I would like to fix this so that a new time is recorded every 60 seconds.
Thanks in advance
|