标签:pre head == int The shel $2 进程 shell
#!/bin/sh
echo "father pid $PPID"
grandpaPid=`ps -f $PPID | awk ‘{if (NR==2) print $3}‘`
echo "grandpa pid $grandpaPid"
grandpaName=`head -n 1 /proc/$grandpaPid/status | awk ‘{print $2}‘`
echo "my grandPa Name : <$grandpaName>"
标签:pre head == int The shel $2 进程 shell
原文地址:https://blog.51cto.com/yaxinsn/2396453