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

Re: Bash different behaviour in jessie versus stretch (maybe a regression?)

I'm no bash expert, but I did take a quick look at bash release notes.  One of
the differences is called out under the heading "New Features In Bash" between
4.4-beta2 and 4.4-rc2:

a.  Using ${a[@]} or ${a[*]} with an array without any assigned elements when
    the nounset option is enabled no longer throws an unbound variable error.


I think this change explains the difference in "Version 3".

With version 2, the difference is in how here-strings are handled.

$ echo $BASH_VERSION; od -ta <<<$(echo -e "a\nb\nc")
0000000   a  sp   b  sp   c  nl

$ echo $BASH_VERSION; od -ta <<<$(echo -e "a\nb\nc")
0000000   a  nl   b  nl   c  nl

With this knowledge in hand, I returned to the change notes and found between
4.4-alpha and 4.4-beta:

z.  Bash no longer splits the expansion of here-strings, as the documentation
    has always said.

So for better or for worse, I think these changes are both deliberate and
documented in the release notes.


Reply to: