This came up on comp.unix.shell:
There appears to be a parsing problem in bash where the sequence
$$'...' is treated as $'...', and $$"..." as $"...", when inside
$(...).
$ echo 'x\nx'
x\nx
$ echo $'x\nx'
x
x
$ echo $$'x\nx'
86293x\nx
$ echo $(echo $'x\nx')
x x
$ echo $(echo $$'x\nx')
x x
This is with bash 4.4.12... but a quick check shows the same behavior
with 4.2.37.
--
Christian "naddy" Weisgerber naddy@mips.inka.de