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


Groups > gnu.bash.bug > #16009

Re: command_not_found_handle() flaw

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: command_not_found_handle() flaw
Date Tue, 10 Mar 2020 13:48:22 -0400
Lines 13
Approved bug-bash@gnu.org
Message-ID <mailman.2422.1583862534.2412.bug-bash@gnu.org> (permalink)
References <CAJOr74gyTOEnYNCG3EPAVJq5VkmJxJ_9tv_TwbmKPBGugdvnWw@mail.gmail.com> <20200310174822.GA845@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 1583862535 24078 209.51.188.17 (10 Mar 2020 17:48:55 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 <CAJOr74gyTOEnYNCG3EPAVJq5VkmJxJ_9tv_TwbmKPBGugdvnWw@mail.gmail.com>
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 <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <20200310174822.GA845@eeg.ccf.org>
X-Mailman-Original-References <CAJOr74gyTOEnYNCG3EPAVJq5VkmJxJ_9tv_TwbmKPBGugdvnWw@mail.gmail.com>
Xref csiph.com gnu.bash.bug:16009

Show key headers only | 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