using output of
ps -eo pid,comm
Would like to do a md5sum of comm while keeping associated with it's pid.
ps -eo pid,comm | awk '{
tmp="echo -n "$2" | openssl md5 | cut -f2 -d\" \""
tmp | getline cksum
$2=cksum
print
}'
The problem with this if you have extra crap in the comm column such as <defunct> child, etc. It screws everything up.
Open to anything that can pipe this output to a program that calls it. Perl/Python etc. It's for a bash script.
ps -eo pid,comm
Would like to do a md5sum of comm while keeping associated with it's pid.
ps -eo pid,comm | awk '{
tmp="echo -n "$2" | openssl md5 | cut -f2 -d\" \""
tmp | getline cksum
$2=cksum
}'
The problem with this if you have extra crap in the comm column such as <defunct> child, etc. It screws everything up.
Open to anything that can pipe this output to a program that calls it. Perl/Python etc. It's for a bash script.