Hello All,
i hope you are fine.
I need a little help from you people--
inside a script i want to kill a parent process by checking it with the child process..
p_pid=`ps -e | awk '/ra_cmd_d/ {print$1}'`
here i am selecting the child process id in p_pid.
next--
sleep_pid=`ps -af | awk '$3 == '${p_pid}' {print $2}'`
echo $sleep_pid
here i am cheching the P_PID with the 3rd field of 'ps -af' and selecting the respective 2nd column which is the parent id.
now the problem is when i am echoing sleep_pid its showing two values .
12545 13345
first one is the valid one but the second value i cant understand y comming. Everytime the 2nd value changed, seems to be randomly generated.
i want sleep_pid to hold only 12545.
can you please help me to get rid of the second value?
many thanks in advance....
Neel....