Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: command_not_found_handle() flaw Date: Tue, 10 Mar 2020 16:04:29 -0400 Lines: 13 Approved: bug-bash@gnu.org Message-ID: References: <7900c11e-7c5c-1b2b-2ed5-7203bd73c2a9@case.edu> <20200310200429.GB845@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1583870674 28009 209.51.188.17 (10 Mar 2020 20:04:34 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org Mail-Followup-To: bug-bash@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20200310200429.GB845@eeg.ccf.org> X-Mailman-Original-References: <7900c11e-7c5c-1b2b-2ed5-7203bd73c2a9@case.edu> Xref: csiph.com gnu.bash.bug:16012 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.