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

BACKSLASH='\u'
SQUARE='\u[]'
echo $BACKSLASH
echo $SQUARE

gives
\u
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: jil...@stack.nl
> To: edwardcrich...@hotmail.com
> 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
> https://bugs.launchpad.net/bugs/259671
> 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.
> POSIX: 
> http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_02
> 
> The following should print 2 backslashes:
> echo '\\'
> 
> 
> 
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/bash/+bug/259671/+subscribe
                                          
_________________________________________________________________
http://clk.atdmt.com/UKM/go/197222280/direct/01/
Do you have a story that started on Hotmail? Tell us now

-- 
dash parses backslashes in single quotes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to