On Mon, Jan 22, 2024, 01:54 Martin D Kealey <mar...@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.

>

Reply via email to