URL: <https://savannah.gnu.org/bugs/?67326>
Summary: Bash 5.3: Problem with new in-process command
substitution ${..} on macOS
Group: The GNU Bourne-Again SHell
Submitter: None
Submitted: Wed 16 Jul 2025 02:07:39 PM UTC
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 16 Jul 2025 02:07:39 PM UTC By: Anonymous
Hello. I believe there might be a problem with the new ${...} command
substitution ability in bash 5.3. I can repeatedly produce an error on macOS
Sequoia (15.5) on two different machines (one an M1 Mini, the other an M4
Macbook Pro), both using Homebrew bash and with bash compiled directly from
source downloaded from gnu.org. Note that in discussion on r/bash and on the
Homebrew discussions page, some other users do see this or similar issues,
while others don't.
The issue:
bash-5.3$ export TEST=aaabbb
bash-5.3$ echo $( sed 's/a/b/g' <<< $TEST ; )
bbbbbb
bash-5.3$ echo ${ sed 's/a/b/g' <<< $TEST ; }
sed: stdout: Device not configured
bash-5.3$ echo ${| sed 's/a/b/g' <<< $TEST ; }
bbbbbb
Note that whatever I attempt to execute in ${..} produces the same error:
bash-5.3$ echo ${ echo hello; }
-bash: echo: write error: Device not configured
bash-5.3$ echo ${ cat <<< hello; }
cat: write error: Device not configured
bash-5.3$ echo ${ sed 's/e/3/' <<< hello; }
sed: couldn't flush stdout: Device not configured
I have tried launching bash with:
env -i /opt/homebrew/bin/bash --norc --noprofile
but get the same errors when running the above tests.
As mentioned above, I have also compiled bash from scratch using
http://ftp.gnu.org/gnu/bash/bash-5.3.tar.gz and launched it as above (env -i,
norc, noprofile) but get the same errors.
In case it's helpful (the first bash is Homebrew's, the second is my local
build):
bash-5.3$ sw_vers
ProductName: macOS
ProductVersion: 15.5
BuildVersion: 24F74
bash-5.3$ /opt/homebrew/bin/bash --version
GNU bash, version 5.3.0(1)-release (aarch64-apple-darwin24.4.0)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash-5.3$ ~/Code/packages/bash/bash-5.3/bash --version
GNU bash, version 5.3.0(1)-release (aarch64-apple-darwin24.5.0)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67326>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
