Debian Bug report logs - #593237
dash built-in echo expands \nnn sequences

version graph

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

Reported by: "Alexander E. Patrakov" <[email protected]>

Date: Mon, 16 Aug 2010 14:42:01 UTC

Severity: wishlist

Tags: upstream, wontfix

Merged with 538100, 550399, 599834, 652509, 698593

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

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#593237; Package dash. (Mon, 16 Aug 2010 14:42:04 GMT) (full text, mbox, link).


Acknowledgement sent to "Alexander E. Patrakov" <[email protected]>:
New Bug report received and forwarded. Copy sent to Gerrit Pape <[email protected]>. (Mon, 16 Aug 2010 14:42:04 GMT) (full text, mbox, link).


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

From: "Alexander E. Patrakov" <[email protected]>
To: [email protected]
Subject: dash: Can't echo \b
Date: Mon, 16 Aug 2010 20:38:57 +0600
Package: dash
Version: 0.5.5.1-6
Severity: normal

There seems to be no way to produce the sequence "\b" (that's
backslash, then the letter b) using dash's builtin echo. Bash
and /bin/echo work fine. I have tried the following commands in my
shell script:

echo "\b"
echo '\b'

...but they only produce a backspace character (0x08) even though
I have not passed the -e switch.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dash depends on:
ii  debianutils                   3.2.3      Miscellaneous utilities
specific t
ii  dpkg                          1.15.7.2   Debian package management
system
ii  libc6                         2.11.2-2   Embedded GNU C Library:
Shared lib

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true

-- 
Alexander E. Patrakov





Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#593237; Package dash. (Mon, 16 Aug 2010 20:36:06 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]>. (Mon, 16 Aug 2010 20:36:06 GMT) (full text, mbox, link).


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

From: Jonathan Nieder <[email protected]>
To: "Alexander E. Patrakov" <[email protected]>
Cc: [email protected]
Subject: Re: Bug#593237: dash: Can't echo \b
Date: Mon, 16 Aug 2010 15:30:35 -0500
forcemerge 550399 593237
quit

Hi,

Alexander E. Patrakov wrote:

> There seems to be no way to produce the sequence "\b" (that's
> backslash, then the letter b) using dash's builtin echo. Bash
> and /bin/echo work fine. I have tried the following commands in my
> shell script:
> 
> echo "\b"
> echo '\b'
> 
> ...but they only produce a backspace character (0x08) even though
> I have not passed the -e switch.

Indeed, echo is not guaranteed to do that[1].  The Almquist shell that
dash is based on never supported the -e switch.  Changing this
historical behavior would be a big pain.

Portable shell scripts should use

	printf '%s\n' '\b'

and unportable scripts should use

	#!/bin/bash

or similar.

Hope that helps,
Jonathan

[1] http://www.opengroup.org/onlinepubs/9699919799/utilities/echo.html




Forcibly Merged 550399 593237. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Mon, 16 Aug 2010 20:36:08 GMT) (full text, mbox, link).


Forcibly Merged 550399 593237 599834. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Mon, 11 Oct 2010 18:36:10 GMT) (full text, mbox, link).


Changed Bug title to 'dash: document differences from bash' from 'dash: Can't echo \b' Request was from Jonathan Nieder <[email protected]> to [email protected]. (Tue, 15 Feb 2011 00:30:13 GMT) (full text, mbox, link).


Severity set to 'wishlist' from 'normal' Request was from Jonathan Nieder <[email protected]> to [email protected]. (Tue, 15 Feb 2011 00:30:15 GMT) (full text, mbox, link).


Added tag(s) upstream. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Tue, 15 Feb 2011 00:30:16 GMT) (full text, mbox, link).


Disconnected #550399 from all other report(s). Request was from Jonathan Nieder <[email protected]> to [email protected]. (Tue, 15 Feb 2011 00:36:07 GMT) (full text, mbox, link).


Merged 550399 593237 599834. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Tue, 15 Feb 2011 00:45:07 GMT) (full text, mbox, link).


Changed Bug title to 'dash built-in echo expands \nnn sequences' from 'dash: document differences from bash' Request was from Jonathan Nieder <[email protected]> to [email protected]. (Tue, 15 Feb 2011 00:45:09 GMT) (full text, mbox, link).


Forcibly Merged 538100 550399 593237 599834. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Sun, 21 Aug 2011 06:03:04 GMT) (full text, mbox, link).


Merged 538100 550399 593237 599834 652509. Request was from Jonathan Nieder <[email protected]> to [email protected]. (Sun, 18 Dec 2011 00:36:10 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).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 12:10:37 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.