How can I get the PID of a subshell in bash3.x?

bash

Solution

You can try: `bash -c 'echo $PPID'`. This works for me on bash 4.1:

$ echo $$
8792
$ ( echo $BASHPID; echo $(bash -c 'echo $PPID') )
12987
12987

Problem

Is it possible to get `$BASHPID` value in bash3.x? Actually, I cannot find any description about it in bash3.x man, but it's available in bash4.x.

Original source