Prefix the current date and time to the output of ps

Hi,

I need to write a script, that will take the current date, time, and the output from [sroot@duqaMX51L-27253 ~]# ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm

and spit it to a file, so it'll look like this...

  PID   TID CLS RTPRIO  NI PRI PSR %CPU STAT WCHAN          COMMAND
    1     1 TS       -   0  23   0  0.0 S    -              init
    2     2 FF      99   - 139   0  0.0 S    migration_thre migration/0
    3     3 TS       -  19   5   0  0.0 SN   ksoftirqd      ksoftirqd/0
    4     4 FF      99   - 139   1  0.0 S    migration_thre migration/1
    5     5 TS       -  19   5   1  0.0 SN   ksoftirqd      ksoftirqd/1

Or an alternative way?

Thanks,
Bloke

where you want to put the date and time in the above output?

Hi,

do u want something like...

date;ps -eo pid,taskid,class,pri,psr,wchan,comm;date

or where you want to put date & time?