Question: ----LINUX BASH SCRIPTING--- Hello, I have a list of ppid, I want to list them as PID and COMM for each value, I did it

----LINUX BASH SCRIPTING---

Hello,

I have a list of ppid, I want to list them as PID and COMM for each value, I did it this way which works fine except when $a= 0(root) because ps -p doesn't work for pid 0 anyway, is there another way where I can do the same without getting error for pid 0?

----LINUX BASH SCRIPTING--- Hello, I have a list of ppid, I want

echo -e "PID] tCoMM" for a in Slist do #print the pid and command of each parent process ps -p Sa ho pid, comm #echo $a done echo -e "PID] tCoMM" for a in Slist do #print the pid and command of each parent process ps -p Sa ho pid, comm #echo $a done

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!