Please help!!


 
Thread Tools Search this Thread
Operating Systems Solaris Please help!!
# 1  
Old 07-16-2004
Please help!!

I have a command in my script:
Code:
  ps -u $user -o pid,ppid,pcpu,stime,stat,comm

This line works fine in Linux. But it won't work on Solaris b/c the "format" of "stat" does not exist in Solaris? I got the following error:
Code:
ps: unknown output format: -o stat
usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
        [ -u userlist ] [ -U userlist ] [ -G grouplist ]
        [ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
  'format' is one or more of:
        user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
        pri opri pcpu pmem vsz rss osz nice class time etime stime
        f s c lwp nlwp psr tty addr wchan fname comm args projid project

Does it use a different name other than stat that's not obvious in the list above????
Smilie
# 2  
Old 07-16-2004
Try

$ ps -u $user -o pid,ppid,pcpu,stime,s,comm

See the man page for ps - search for stat - should bring you to S The state of the process:

O Process is running on a processor
S Sleeping
R runnable
Z zombie state
T Process is stopped
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question