helpThe GNU Bourne-Again SHell - Support: sr #109368, break n stops at file boundrary...


sr #109368: break n stops at file boundrary from version 4.4

Submitted by:  Peder Stray <pstray>
Submitted on:  Sat 12 Aug 2017 11:52:14 AM UTC  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 15 Aug 2017 03:52:13 PM UTC, comment #2:

Ah, good to know it was an intentional change :) And thanks for explaining.

Peder Stray <pstray>
Tue 15 Aug 2017 12:36:40 PM UTC, comment #1:

The issue of `break' inside a shell function affecting loops in the calling context was reported as a bug on the Posix mailing list and discussed there. We ultimately decided that executing a shell function does not meet the Posix requirement of `lexically enclosing' a loop.

If you want the previous behavior, you can set the compat43 shell option, or set BASH_COMPAT=43. This is explained in COMPAT.

Chet Ramey <chet>
Project Administrator
Sat 12 Aug 2017 11:52:14 AM UTC, original submission:

Just upgraded my dist to one that includes bash-4.4, and now i get a whole bunch of failures in my custom setup related to the issue that "break n" now stops at file boundraries, and not continuing out a source as it did in all versions up to bash-4.4.

Did a bisect on the git-repo, and a0c0a00fc419b7bc08202a79134fcd5bc0427071 is the first that has this new behaviour.

I use the old behaviour to break out of a sourced file if some conditions of it is not met, maybe in a more complicated manner than needed, but as i have no othe way of returning out of a sourced file from within a function, that was the way i did it...

Is this change of behaviour intentional?

Peder Stray <pstray>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by pstray (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-15 chet StatusNone => Works For Me

    Back to the top

    Powered by Savane 3.3