izabera 1570779394 learn $BASHPID is the pid of the current subshell. for a posix alternative, pid=$(sh -c 'echo "$PPID"') izabera 1570779819 forget izabera 1570779826 learn $BASHPID is the pid of the current subshell. for a posix alternative, pid=$(exec sh -c 'echo "$PPID"')