[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ./script doesn't work in completion function
From: |
Grisha Levit |
Subject: |
Re: ./script doesn't work in completion function |
Date: |
Mon, 22 Jan 2024 03:17:22 -0500 |
On Mon, Jan 22, 2024, 01:54 Martin D Kealey <martin@kurahaupo.gen.nz> wrote:
> You seem to have created an invalid executable. It seems that scripts
> without a #! can only be run with help from the debugger library;
That's not quite what happens. These scripts get executed by forking the
current bash process (without exec). The new shell resets its state and
runs the script.
$ ./b
> ./b:
>
> /home/martin/lib/bash/f3a35a2d601a55f337f8ca02a541f8c033682247/share/bashdb/bashdb-main.inc:
> No such file or directory
> ./b: warning: cannot start debugger; debugging mode disabled
> B
The debugger message is afaict an artifact of not quite resetting
completely -- if you had extdebug on in the shell from which you ran `./b`,
the forked shell will try to load the debugger start file (as when running
`bash -O extdebug ./b`)
Note that the script still runs, `B` is printed.
>
Re: ./script doesn't work in completion function, Chet Ramey, 2024/01/22