On Tue, Mar 10, 2020 at 08:57:26PM +0100, Phi Debian wrote: > Secondly, if yuio insist on going on the subshell path, then $$ and $PPID > ought to be setup appropriately, here ther are plain bogus.
wooledg:~$ command_not_found_handle() { echo "\$\$=$$ BASHPID=$BASHPID"; } wooledg:~$ echo "\$\$=$$ BASHPID=$BASHPID" $$=859 BASHPID=859 wooledg:~$ wyeiruwyer $$=859 BASHPID=15619 It looks correct to me. $$ is the PID of the main script, and $BASHPID is the PID of the subshell.