cat function/command_not_found_handle
m "$BASH_COMMAND"
type m
m is aliased to `vim'
type command_not_found_handle
command_not_found_handle is a function
command_not_found_handle ()
{
vim "$BASH_COMMAND"
}
foo
# vim opens, with the bash cmd as arg ( threated as filename )
"vim "$BASH_COMMAN
I see; I thought this change of behaviour was an unintentional
regression since I noticed that there were some changes to traps.
I actually think this new behaviour makes more sense.
I think that that old DEBUG trap can be ported to bash5 like so:
debug_prompt () { read -p "[$BASH_SOURCE:$LINEN
am additional meta data structure
one for saving and restoring traps
one for like is-in-debug-trap
On Fri, Nov 5, 2021, 17:12 Chet Ramey wrote:
> On 11/4/21 5:49 PM, Emanuele Torre wrote:
>
> > Bash Version: 5.1
> > Patch Level: 8
> > Release Status: release
> >
> > Description:
> >BASH_COMM
On 11/4/21 5:49 PM, Emanuele Torre wrote:
Bash Version: 5.1
Patch Level: 8
Release Status: release
Description:
BASH_COMMAND does not expand to the expected value when used in a
subshell inside a trap.
This is a variant of
https://lists.gnu.org/archive/html/help-bash/2021-10/msg00269.h
> $ cat test1
> trap 'echo "$BASH_COMMAND"' DEBUG
> echo hello
> $ cat test2
> trap '(echo "$BASH_COMMAND")' DEBUG
> echo hey
> bash
And the content of the test files was really:
$ cat test1
trap 'echo "$BASH_COMMAND"' DEBUG
echo hey
$ cat test2
trap '(echo "$BASH_COMMAND"