bug-bash
[Top][All Lists]
Advanced

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

Re: declare/local severely mishandle arrays with quoted -g/-A


From: Chet Ramey
Subject: Re: declare/local severely mishandle arrays with quoted -g/-A
Date: Tue, 29 Sep 2026 13:54:36 -0400
User-agent: Mozilla Thunderbird

On 9/28/26 5:21 PM, Robert Elz wrote:
     Date:        Mon, 28 Sep 2026 15:39:32 -0400
     From:        Chet Ramey <chet.ramey@case.edu>
     Message-ID:  <54bbdcec-6eae-4fa2-be3f-f7159f014d18@case.edu>

Not that I care about this,

You seem to.


   | It does this by looking at the next word,
   | which it assumes is an option string if it begins with `-'.

That's OK, though I'd assume it should look at more than just the
first word, in case there are things with the options not all following
a single '-' (declare -g -i ...)

It looks at zero or more words beginning with `-'. The explanation
aligns with the reported case.



   | This can also be defeated by quoting the word or using variable expansion.

But that's just dumb.

I'm sure you think so.

What it should be doing is
"I've thought about changing the way this code works, and maybe I will
someday. But today is not that day."

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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