GNU bug report logs - #17961
"od -c" producing numbers greater than 255 ?

Previous Next

Package: coreutils;

Reported by: Sebastian Pipping <sebastian <at> pipping.org>

Date: Sun, 6 Jul 2014 22:58:04 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Sebastian Pipping <sebastian <at> pipping.org>, Bernhard Voelker <mail <at> bernhard-voelker.de>, 17961 <at> debbugs.gnu.org
Subject: bug#17961: "od -c" producing numbers greater than 255 ?
Date: Mon, 07 Jul 2014 06:56:52 -0600
[Message part 1 (text/plain, inline)]
On 07/06/2014 06:27 PM, Sebastian Pipping wrote:
> Hello!
> 
> 
> Intersting, thanks for your reply.  For "-c" the man page reads
> 
>   "printable character or backslash escape"
> 
> I don't really see any mention of octal fallback in there :)
> Personally, I would expect (and prefer) \x?? output for any
> non-printable bytes from that description.  My vote too add that or at
> least making the man page more precise about "-c", that would be cool.

Alas, we can't change the behavior; it is mandated by POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/od.html

-c
    [XSI] [Option Start] Interpret bytes as characters specified by the
current setting of the LC_CTYPE category. Certain non-graphic characters
appear as C escapes: "NUL=\0", "BS=\b", "FF=\f", "NL=\n", "CR=\r",
"HT=\t"; others appear as 3-digit octal numbers. [Option End]

> 
> I guess "od -t u1" is what I'll use in the meantime.

Yes, that is a reasonable action.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 6 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.