bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command_not_found_handle() flaw


From: Greg Wooledge
Subject: Re: command_not_found_handle() flaw
Date: Tue, 10 Mar 2020 13:48:22 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Mar 10, 2020 at 06:37:24PM +0100, Phi Debian wrote:
> In a nutshell to implement a function autoloading I want to plug into
> command_not_found_handle(), but I need command_not_found_handle()be
> evaluated in the shell context, not in a subshell.

You can't.  Bash has already forked the subshell before searching for
the command that's not found.  The command_not_found_handle runs in
the already existing subshell.

> To demonstrate the bug, suffice to do this

It's not a bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]