Bug#672361: bootlogd: escape sequences should be filtered out

Jesse Smith jsmith at resonatingmedia.com
Sun Aug 11 22:08:55 BST 2019


On Sun, 11 Aug 2019 17:47:17 +0000 Dmitry Bogatov wrote:

> > I'd like to point out though that with such an option enabled, it is
> > going to result in some weird output. If all escape sequences are
> > printed to the file, tools like "less" can handle it, but other (more
> > raw) text manipulation tools such as "head" and "tail" will end up
> > mangling the lines.
>
> No. When you output raw escape sequences on terminal, they will be
> interpreted by terminal, so `head', `tail' and `grep' output will be
readable and colored. Pager `less' with -R option also interpret escape
symbols.

I wasn't speaking theoretically. I tried it and the "head", "cat" and
"tail" commands mangle the lines of the log file when escape sequences
are not escaped. Output from "less" is clean though and looks correct.

> Looks like your terminal interpret '\r' incorrectly.

What makes you think that? The lines look exactly as I would expect them
to look.

> What does following command print on your terminal?

>  $ bash -c "printf 'foo\rbar'"

It prints "bar", just as it should.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.chiark.greenend.org.uk/pipermail/debian-init-diversity/attachments/20190811/adf31843/attachment.html>


More information about the Debian-init-diversity mailing list