Re: [PATCH] echo: fix octal escaping with \1...\7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Oct 31, 2011, at 07:12, Eric Blake wrote:

> [adding bug-libtool]
[removing, because I'm not registered.]

> On 10/30/2011 10:23 PM, Mike Frysinger wrote:
>> On Sunday 30 October 2011 23:41:58 Herbert Xu wrote:
>>> Mike Frysinger wrote:
>>>> POSIX states that octal escape sequences should take the form \0num
>>>> when using echo.  dash however additionally treats \num as an octal
>>>> sequence.  This breaks some packages (like libtool) who attempt to
>>>> use strings with these escape sequences via variables to execute sed
>>>> (since sed ends up getting passed a byte instead of a literal \1).
> That's a bug in libtool for using "echo '\1'" and expecting sane behavior.  Can you provide more details on this libtool bug, so we can get it fixed in libtool?  Or perhaps it has already been fixed in modern libtool, and you are just encountering it in an older version?
Yes, there's value in coding defensively.  However:

I used to know a statement in POSIX that builtins should behave
identically to the executables in /bin (or perhaps /usr/bin)
except for performance.  So, testing with dash on Ubuntu:

\! $ echo "\1"

\! $ /bin/echo "\1"
\! $ 

I recognize that following this precept would make the behavior
of the builtin "echo" platform-dependent.  But that could be
managed in autoconf.

-- gil

To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

Powered by Linux