Sometimes my calculated PPID is not the actual PPID

Solution Verified - Updated -

Issue

I have a script which is calculating the parent PID of a process

PPID_1=`expr $PPID - 1`
echo "PPID -> $PPID"
echo "PPID_1 -> $PPID_1"

SOMETIMES, the PPID outputted during remote login is not equal the PID confirmed from "ps" output,
is it normal?

Environment

Red Hat Enterprise Linux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In