Bug#930805: dash: Dash strips out newline from multi-line string literal when line starts with an empty $()

2020-07-31 Thread Jakub Wilk

Control: tags -1 + fixed-upstream

* Martin D. , 2019-06-20, 19:22:

echo "
$(echo '') hello
$(echo '') world"

will output " hello world", when other shells I've tried
(zsh, bash, ksh) all output:

"
hello
world"


This was fixed upstream in v0.5.11:
https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=c4f4ee8ecf858348

--
Jakub Wilk



Bug#930805: dash: Dash strips out newline from multi-line string literal when line starts with an empty $()

2019-06-20 Thread Martin D.
Package: dash
Version: 0.5.7-4+b1
Severity: normal

Dear Maintainer,

In multi-line string literals, a line which starts with a $()-style
subshell which outputs an empty string will have its trailing newline
stripped. For example, this code:

echo "
$(echo '') hello
$(echo '') world"

will output " hello world", when other shells I've tried
(zsh, bash, ksh) all output:

"
 hello
 world"

I haven't looked at what posix says about this particular issue,
but the behavior of all the other shells looks way more sensible in my
opinion. If they're actually wrong and dash implements posix correctly,
feel free to ignore this issue.

-- System Information:
Debian Release: 8.11
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-5-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dash depends on:
ii  debianutils  4.4+b1
ii  dpkg 1.17.27
ii  libc62.19-18+deb8u10

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true