Resolved before asked: cat /proc/1111/status | grep PPid
| |||||
feedback
|
|
Command line:
Function:
Script:
If no PID is supplied to the function or the script, they default to show the PPID of the current process. | |||
|
feedback
|
|
Read /proc/$PID/status. Can be easily scripted:
#!/bin/sh
P=$1
if [ -z "$P" ]; then
read P
fi
cat /proc/"$P"/status | grep PPid: | grep -o "[0-9]*"
| |||||
feedback
|