Comment 6 for bug 259671

Is this, then, the same as the bug I reported originally - that was later replaced by echo '\\':

echo $SQUARE

u[] on ubuntu and \u[] everywhere else

So it is the echo command on Ubuntu dash only?
A work around would be to use printf in place of echo when using ubuntu? This would work reliably on other versions of sh?

> Date: Fri, 14 May 2010 22:55:17 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 259671] Re: dash parses backslashes in single quotes
> The issue is not with the single quotes, but with dash's echo builtin.
> Apparently, the way they are compiled and configured by default on
> Ubuntu, dash's echo builtin interprets backslash escape sequences while
> bash's does not.
> According to POSIX, this interpretation is permitted; with the XSI
> option (following traditional System V), it is required.
> Practically, the echo utility can only be used portably if both
> backslashes and initial hyphens (which could be interpreted as options)
> are omitted. The printf utility is a good substitute.
> I don't see much point in changing dash here.
> --
> dash parses backslashes in single quotes
> You received this bug notification because you are a direct subscriber
> of the bug.
> Status in Bourne Again Shell: Invalid
> Status in “dash” package in Ubuntu: Confirmed
> Status in “dash” package in Debian: New
> Bug description:
> In dash, backslashes are parsed within single quotes, contradicting POSIX and it's own man page.
> The following should print 2 backslashes:
> echo '\\'
> To unsubscribe from this bug, go to:

Do you have a story that started on Hotmail? Tell us now