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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content