Debian Bug report logs - #698593
dash does not obey POSIX quoting rules for backlashes in single quotes

version graph

Package: dash; Maintainer for dash is Andrej Shadura <[email protected]>; Source for dash is src:dash (PTS, buildd, popcon).

Reported by: Norman Ramsey <[email protected]>

Date: Sun, 20 Jan 2013 20:27:01 UTC

Severity: wishlist

Tags: upstream, wontfix

Merged with 538100, 550399, 593237, 599834, 652509

Found in versions dash/0.5.5.1-6, dash/0.5.5.1-2, dash/0.5.4-12, dash/0.5.5.1-7.4, 0.5.5.1-7.4ubuntu1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#698593; Package dash. (Sun, 20 Jan 2013 20:27:04 GMT) (full text, mbox, link).


Acknowledgement sent to Norman Ramsey <[email protected]>:
New Bug report received and forwarded. Copy sent to Gerrit Pape <[email protected]>. (Sun, 20 Jan 2013 20:27:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Norman Ramsey <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: dash does not obey POSIX quoting rules for backlashes in single quotes
Date: Sun, 20 Jan 2013 15:24:35 -0500
Package: dash
Version: 0.5.5.1-7.4
Severity: important

POSIX rules specify that a backslash receive no special treatment
when within single quotes.  Unfortunately dash does not obey:

  : nr@homedog 10452 ; /bin/ksh93
  : nr@homedog 10453 ; echo 'hello\n'
  hello\n
  : nr@homedog 10454 ; /bin/dash
  : nr@homedog ! ; echo 'hello\n'
  hello

  : nr@homedog ! ;

This bug is breaking my POSIX-compliant shell scripts.


-- System Information:
Debian Release: 6.0.6
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates'), (100, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages dash depends on:
ii  debianutils                   3.4        Miscellaneous utilities specific t
ii  dpkg                          1.15.8.13  Debian package management system
ii  libc6                         2.13-37    Embedded GNU C Library: Shared lib

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true



Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#698593; Package dash. (Sun, 20 Jan 2013 21:12:10 GMT) (full text, mbox, link).


Acknowledgement sent to Jonathan Nieder <[email protected]>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Sun, 20 Jan 2013 21:12:10 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Jonathan Nieder <[email protected]>
To: Norman Ramsey <[email protected]>
Cc: [email protected]
Subject: Re: dash does not obey POSIX quoting rules for backlashes in single quotes
Date: Sun, 20 Jan 2013 13:09:31 -0800
forcemerge 538100 698593
quit

Hi Norman,

Norman Ramsey wrote:

>   : nr@homedog ! ; echo 'hello\n'
>   hello
>
>   : nr@homedog ! ;
>
> This bug is breaking my POSIX-compliant shell scripts.

Not POSIX-compliant, unfortunately.  See

  http://bugs.debian.org/613473
  http://bugs.debian.org/538100
  http://bugs.debian.org/490605

Your best bet for the future is to use

	printf '%s\n' 'hello\n'

Sorry I don't have better news,
Jonathan



Severity set to 'wishlist' from 'important' Request was from Jonathan Nieder <[email protected]> to [email protected]. (Sun, 20 Jan 2013 21:12:15 GMT) (full text, mbox, link).


Marked as found in versions dash/0.5.5.1-6, dash/0.5.5.1-2, dash/0.5.4-12, and 0.5.5.1-7.4ubuntu1. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Sun, 20 Jan 2013 21:12:16 GMT) (full text, mbox, link).


Added tag(s) upstream and wontfix. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Sun, 20 Jan 2013 21:12:16 GMT) (full text, mbox, link).


Merged 538100 550399 593237 599834 652509 698593 Request was from Jonathan Nieder <[email protected]> to [email protected]. (Sun, 20 Jan 2013 21:12:18 GMT) (full text, mbox, link).


Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#698593; Package dash. (Tue, 22 Jan 2013 03:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected] (Norman Ramsey):
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Tue, 22 Jan 2013 03:57:03 GMT) (full text, mbox, link).


Message #23 received at [email protected] (full text, mbox, reply):

From: [email protected] (Norman Ramsey)
To: [email protected]
Subject: mistake -- problem is in echo builtin
Date: Mon, 21 Jan 2013 22:54:18 -0500
I misdiagnosed the problem.  Further investigation reveals
that dash is handling quoting correctly, but that dash's
builtin 'echo' function is converting those escape sequences.
The POSIX standard for 'echo' says that behavior with 
backslash is implementation-defined.  So there is no bug after all.

Please close this ticket, and I apologize for the noise.


Norman Ramsey



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 15:36:07 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.