bug-bash
[Top][All Lists]
Advanced

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

Re: break no longer breaks out of loops defined in an outer context


From: Stephane Chazelas
Subject: Re: break no longer breaks out of loops defined in an outer context
Date: Wed, 1 Mar 2017 12:43:04 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

2017-02-28 16:18:05 -0500, Chet Ramey:
[...]
> > Just my personal opinion, but I think I'd rather the spec had
> > been updated to accomodate the bash (and many other shells)
> > behaviour rather than bash breaking its backward compatibility
> > to comply to a requirement that is not particularly useful
> > myself.
> 
> That's why I made the bash-4.3 behavior available via the shell
> compatibility level mechanism.
[...]

That's good to have at least a mechanism to make sure scripts
are not going to be broken by a future, incompatible version of
the shell.

Would you recommend people start adding:

shopt -s compat44 2> /dev/null || true

at the start of their script that they develop for bash-4.4 now
so that it still works even when bash-6.0 makes a non-backward
compatible change?

It seems there's a compatXX option for each of the versions
since bash31. Will you keep doing it for every version?

Maybe a shopt -s compat=44 to avoid filling up the option
namespace would be better. It's not clear what combining several
compat options could do. For instance with shopt -s compat31
compat43 would not be compatible with bash-4.3 in that the [[ =~
]] operator would work the bash-3.1 way. That could cause
confusion.

(or #! /bin/bash -o compat=4.4 or --compat=4.4 to link to a
parallel thread here).
-- 
Stephane



reply via email to

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