Try using bash -c 'echo $PPID' within the sub-shell instead of $BASHPID.
Try using bash -c 'echo $PPID' within the sub-shell instead of $BASHPID.

* $BASHPID is not available in Bash 3.x.
  https://riptutorial.com/bash/example/16862/-bashpid

postmodern/chruby,postmodern/chruby