0

I know bash tries very hard to keep new versions compatible with previous ones.

However they sometime introduced (minor, but still) breaking changes:

for exemple when we could no longer have : { foo } # which now hangs

but instead had to have : { foo ;} # ie have a ; or a newline before the closing }

(not sure which version introduced that, it was more than 20 years ago ^^)

My question is : how to find out which other "breaking" changes occured along the whole history of bash updates?

4
  • side question: how to add a simple "newline" in the question without having to do 2 newlines (which introduce a paragraph separator) ? ^^ Commented 23 hours ago
  • 2
    Add two spaces at the end of the line to force a line break. Commented 22 hours ago
  • 1
    { foo } is (and AFAIK always has been in bash) the { keyword (which introduces a command group) followed by the foo command with } as argument (and you'll need a } closing keyword (in command position, so for instance following a ; or & or newline) later to close the command group). Can you clarify what you mean by it hangs? Commented 22 hours ago
  • Correction, looks like before bash 2.0 (1996), bash did indeed not treat the } in { foo } as an argument to foo as the Bourne or Korn shell did and as POSIX requires. That's mentioned in the COMPAT file from 2.0. Commented 22 hours ago

1 Answer 1

4

Breaking changes are listed (tersely) in the COMPAT file in the source distribution. I imagine most distributions provide this in their packages too — for example, /usr/share/doc/bash/COMPAT.gz in Debian and derivatives.

3
  • See also info bash compat for the section about its compatibility modes which lists some of the changes it is possible to revert by setting $BASH_COMPAT. It doesn't go as far back as bash 1.x which you'd need to revert to for that handling of { foo }. Commented 22 hours ago
  • thanks a lot ! I'm having a look (I tried to search a way to comb through "all" the READMEs in the git history (and didn't find how to) but didn't notice "COMPAT") Commented 22 hours ago
  • The COMPAT file is perfectly what I wanted, thank you (it mentions my exemple as number 2., lines 31 to 48) Commented 18 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.