Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Expansion of \c escape sequences



Wayne Davison wrote:
> I'm curious which version of coreutils behaves that way?  I've got 5.2.1
> on my system, and it behaves as zsh does.

Indeed, echo seems to have been changed after the 5.2.1 release (I tested
with 5.3.0).  Printf behaves as I described even in 5.2.1, though.

> If we want to change the
> behavior, the attached patch should handle it.

Not quite, since it doesn't handle these cases:

%/usr/bin/echo -e 'a\c' b
a
%/usr/bin/printf '%s\c%s' a b c
a
%/usr/bin/printf '%b %b\n' a b 'c\c' d e
a b
c

I've attached an extended patch that should do this.

Regards,
Thorsten Dahlheimer

Attachment: backslash-c_2.patch
Description: Binary data



Messages sorted by: Reverse Date, Date, Thread, Author