bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variable set in exec'ing shell cannot be unset by child shell


From: Martin D Kealey
Subject: Re: variable set in exec'ing shell cannot be unset by child shell
Date: Sun, 15 Oct 2023 14:31:08 +1000

On Sun, 15 Oct 2023, 03:15 Ti Strga, <wearyofallthiscrap@gmail.com> wrote:

> On Fri, Oct 13, 2023 at 5:59 PM Grisha Levit <grishalevit@gmail.com>
> wrote:
> > IMHO you'd be better off just putting a `{` line at the start and `}`
> line at the end of your scripts
>

The big weakness of the "{}" approach is that if a writer forgets to do
> that, there's no way to detect it until a script is modified and the
> running one crashes.  But in the case of cloning, we can add such explicit
> test-and-detection for "did you forget to trigger the cloning" in the few
> scripts that really, really need it.
>

I think I would attack this from an entirely different angle: what about
simply modifying Baeh so that it slurps in the entire file upon opening it?

You could even hide that inside an LD_PRELOAD module so you don't have to
recompile Bash, and so that it's inherited automatically.

-Martin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]