fix ps statement and update version#2
Conversation
dyaandys
left a comment
There was a problem hiding this comment.
I would not approve this pull request.
andys@p9-72qa:/devt/users/andys$ ps -o cmd
ps: 0509-048 Flag -o was used with invalid list.
Usage: ps [-AMNZaedfklm] [-n namelist] [-F Format] [-o specifier[=header],...]
[-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist] [-c classlist] [ -T pid] [ -L pidlist ]
[-@ [wparname] ]
Usage: ps [aceglnsuvwxX] [t tty] [processnumber]
mac5:~ andys$ ps -o cmd
ps: cmd: keyword not found
ps: no valid keywords; valid keywords:
%cpu %mem acflag acflg args blocked caught comm command cpu cputime etime f flags gid group
ignored inblk inblock jobc ktrace ktracep lim login logname lstart majflt minflt msgrcv msgsnd ni
nice nivcsw nsignals nsigs nswap nvcsw nwchan oublk oublock p_ru paddr pagein pcpu pending pgid pid
pmem ppid pri prsna pstime putime re rgid rgroup rss ruid ruser sess sig sigmask sl start stat
state stime svgid svuid tdev time tpgid tsess tsiz tt tty ucomm uid upr user usrpri utime vsize vsz
wchan wq wqb wql wqr xstat
I’d go for
ps -o comm | grep -iv defunct | sed -n ‘2,$p’
…en check to ensure its not a Zombie
This address the problem mentioned in #1.