On Wed, Sep 06, 2023 at 02:13:44AM +0000, William Bader wrote:
> Has bash ever had a change before that would break valid scripts?

Yes.  Many times, sadly.  Most recently, bash 5.2 introduced some changes
to how associative array indexes are handled, which will break
backward compatibility in several ways.

The changing of how "set -e" is handled (several times, mostly driven
by POSIX) has also caused scripts to work differently.

There are lots more examples, but those are the ones I think of first.

> Could the printf format change be settable by a variable or by an option like 
> the -e/-E in echo?
> 
> Is it necessary for bash printf to match C printf?
> 
> I suppose that it is already decided.

Chet has answered these.

> Does shellcheck track variables well enough to warn if the new %b is passed 
> something that doesn't look like a numeric string?

There isn't a "new %b", so this question is theoretical.  Shellcheck is
an independent project, and if a new printf format were to be introduced,
you could talk to its developer about getting the relevant changes into
shellcheck in a timely fashion -- again, theoretically.

Reply via email to