On 6/29/23 8:51 AM, Chet Ramey wrote:
It should be consistent, at least. I think the string assignment behavior
is the most reasonable: assignments return 1 but there's no assignment
error. I'll look at how compound assignments are different.
I have reconsidered this. Making assignments that are supposed to be
ignored set $? to 1 means that a shell with errexit enabled will exit.
I don't think that's desirable. I don't think attempted assignments to
noassign variables should change $?.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/