Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16009

Re: command_not_found_handle() flaw

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: command_not_found_handle() flaw
Date 2020-03-10 13:48 -0400
Message-ID <mailman.2422.1583862534.2412.bug-bash@gnu.org> (permalink)
References <CAJOr74gyTOEnYNCG3EPAVJq5VkmJxJ_9tv_TwbmKPBGugdvnWw@mail.gmail.com> <20200310174822.GA845@eeg.ccf.org>

Show all headers | View raw


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.

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: command_not_found_handle() flaw Greg Wooledge <wooledg@eeg.ccf.org> - 2020-03-10 13:48 -0400

csiph-web