i want to log the output of ps.
i want to see the ps outpt line by line as i see in the stdout
but when i write it to a file it concatenates all lines
do you have any suggestion?
what i am using:
echo `ps -ef -o cmd,cpu,pcpu,cputime,nswap`>>log.txt
what i am getting:
Mon Sep 11 19:26:08 EEST 2006 CMD CP %CPU TIME NSWAP [kernel idle] 224 22.4 4-15:53:33 0 /sbin/init -a 0 0.0 2:15.24 0 [kproc_creato
r_d 0 0.0 0:00.96 0 [icsmsg_arr_nopr 0 0.0 0:00.00 0 [icssvr_nomem_da 0 0.0 0:00.00 0 [icssvr_throttle 0 0.0 0:00.00 0 [icssvr_daemo
n_f 0 0.0 0:01.03 0 [icssvr_daemon_f 0 0.0 0:00.00 0 [icssvr_nanny] 0 0.0 0:00.22 0 [icscli_throttle 0 0.0 0:00.00 0 [CFS daemon] 0
0.0 0:00.00 0 [icssvr_daemon_p 0 0.0 0:00.00 0 [icssvr_daemon_p 0 0.0 0:00.00 0 [icssvr_daemon_p 0 0.0 30:39.70 0 [icssvr_daemon_p 0
0.0 0:00.15 0 /sbin/kloadsrv 0 0.0 0:00.43 0 /sbin/hotswapd 0 0.0 0:00.51 0 [icssvr_daemon_p 0 0.0 0:00.32 0 /sbin/vold -k 0 0.0 0: