#989239 dash: support $'…' style quotes

Package:
dash
Source:
dash
Description:
POSIX-compliant shell
Submitter:
Christoph Anton Mitterer
Date:
2026-02-28 01:11:01 UTC
Severity:
wishlist
Tags:
#989239#5
Date:
2021-05-30 00:41:43 UTC
From:
To:
Hi.

It would be nice if dash could support $'…' style strings as bash does.

This also seem to be sooner or later going to be part of POSIX:
https://austingroupbugs.net/view.php?id=249#c599

Cheers,
Chris.

#989239#10
Date:
2024-07-03 12:21:19 UTC
From:
To:
Control: severity -1 normal
Control: found -1 0.5.12-2
Control: found -1 0.5.12-9
It is mandatory dash supports $'-escapes, because they are part of
Issue 8 (POSIX.1-2024).

Consult your PDFs' XCU, 2 Shell Command Language, 2.2 Quoting,
2.2.4 Dollar-Single-Quotes.

Currently dash yields
  $ printf '%s\n' $'\123'
  $\123

But it must do
  $ printf '%s\n' $'\123'
  S

Best,

#989239#21
Date:
2024-09-22 17:58:37 UTC
From:
To:
I'd really appreciate this to be supported in dash. It is a nice and
portable way of printing terminal control sequences, since neither
printf nor echo are required to support the '\e' escape, but
Dollar-Single-Quotes strings are.

#989239#26
Date:
2025-09-17 21:50:05 UTC
From:
To:
I was bit by dash not having support for this construct which is specified in POSIX: my makefile didn't work because dash is the default /bin/sh and this is used by GNU Make. I think the referenced commit fixed this upstream last year but haven't had the chance to test yet.
#989239#33
Date:
2026-02-28 01:09:06 UTC
From:
To:
I have confirmed that this is fixed in dash 0.5.13.1 by
https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=776424a8f9158bfe9f53aa55f931af9f73437caf

наб wrote:

Care should be taken so if this fix makes it into Forky, and any maintainer scripts use this new syntax, that they won't break with a not-yet-upgraded dash from Trixie. Perhaps when the new version of dash is uploaded, it might be smart to have Lintian warning about such assuming Debian Policy still mandates POSIX.1-2017 conformance here.