bug-bash
[Top][All Lists]
Advanced

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

Re: Assigning to BASHPID fails silently


From: PePa
Subject: Re: Assigning to BASHPID fails silently
Date: Thu, 20 Oct 2016 09:39:13 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Picking 2 allows old scripts that work to keep working. Changing to 1
would change the functionality of formerly working scripts in very
undesirable ways. ;-)

> 1. BASHPID is readonly, therefore assignment to it is fatal and the script 
> exits
> (with an error message printed). That's what my previous patch did.
> 
> 2. BASHPID is not read-only, but changes to it are discarded (with the null
> assignement function). Assignments to BASHPID are non-fatal, and it's possible
> to unset it. Once it's unset, it's magical meaning is lost. (I think this is
> what Chet is proposing). noro_bashpid.patch
> 
>> In what possible context would assigning to any of these variables make
>> sense, or be an indication of anything other than a fatal bug in the
>> script? I think they should all be readonly, and produce a proper
>> diagnostic error message upon exit if assigning is attempted.
> [...]
> 
> I wonder the same thing. I don't understand the reasoning for picking (2).
> 



reply via email to

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