> On Jan 30, 2021, at 9:28 PM, "" <k...@plushkava.net> <k...@plushkava.net> 
> wrote:
> 
> Are you certain that you're not testing /bin/bash (version 3.2.57) in the 
> case of macOS? I ask because the bug you describe is said to have been 
> addressed by the release of 4.4-beta [1].
> 
> z.  Bash no longer splits the expansion of here-strings, as the
>    documentation has always said.


I can reproduce the OP's result with the system bash but not with 5.1
or 5.1 patch 4.


% /bin/bash --version | head -n 1
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
% /bin/bash -c 'od -bc <<< $(echo -e "foo\nbar")'
0000000   146 157 157 040 142 141 162 012
           f   o   o       b   a   r  \n
0000010


% work/destroot/opt/local/bin/bash --version | head -n 1
GNU bash, version 5.1.0(1)-release (x86_64-apple-darwin18.7.0)
% work/destroot/opt/local/bin/bash -c 'od -bc <<< $(echo -e "foo\nbar")'
0000000   146 157 157 012 142 141 162 012
           f   o   o  \n   b   a   r  \n
0000010


% bash --version | head -n 1
GNU bash, version 5.1.4(1)-release (x86_64-apple-darwin18.7.0)
% bash -c 'od -bc <<< $(echo -e "foo\nbar")'
0000000   146 157 157 012 142 141 162 012
           f   o   o  \n   b   a   r  \n
0000010


--
vq

Reply via email to