On 10/19/16 5:53 PM, Martijn Dekker wrote: > Op 19-10-16 om 15:18 schreef Chet Ramey: >> On 10/17/16 2:38 PM, Martijn Dekker wrote: >>> bash 4.4.0 (I did not investigate other versions) does not produce an >>> error message if you try to assign something to the BASHPID readonly >>> using either arithmetic or normal assignment. Other readonlies produce a >>> message on an assignment attempt. BASHPID seems to be an exception. >> >> BASHPID is a dynamic variable. There should be a sentence in the man >> page that says assignments to it have no effect (as it does for GROUPS >> and FUNCNAME, for example). > > Assigning to BASHPID most certainly does have an effect. Since you > didn't quote that part, I think you might have missed my point that > attempting this will silently exit the shell without any error message,
This is a consequence of it being marked as readonly, and you running it in a configuration where assignment errors cause the shell to exit. It shouldn't be marked as readonly, and it should be documented that assignments to it are discarded. > 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. OK, you've made your position clear. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/