emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#10045: closed (Unix od command, reverses hex bytes


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#10045: closed (Unix od command, reverses hex bytes in output)
Date: Mon, 14 Nov 2011 17:42:02 +0000

Your message dated Mon, 14 Nov 2011 10:40:27 -0700
with message-id <address@hidden>
and subject line Re: bug#10045: Unix od command, reverses hex bytes in output
has caused the debbugs.gnu.org bug report #10045,
regarding Unix od command, reverses hex bytes in output
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
10045: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10045
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Unix od command, reverses hex bytes in output Date: Mon, 14 Nov 2011 09:56:58 -0500

On Red Hat, the od command reverses the hex bytes.

address@hidden PatientLoadDataFiles]$ cat a

123456

address@hidden PatientLoadDataFiles]$ od -cx a

0000000   1   2   3   4   5   6  \n  \0

        3231 3433 3635 000a

 

On HP-UX, it prints what you’d expect.

plr02:lrxiusr:/plr02_users/lrxiusr/artdadamo> od -cx a

0000000    3132    3334    3536    0a00

          1   2   3   4   5   6  \n

 

Is this a big-endian/little-endian issue?

 

Thanks,

 

Arthur D'Adamo

200 Campus Drive

Collegeville, PA 19426

Of: 610-244-2296

Cl: 215-872-5925

 


--- End Message ---
--- Begin Message --- Subject: Re: bug#10045: Unix od command, reverses hex bytes in output Date: Mon, 14 Nov 2011 10:40:27 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1
tag 10045 notabug
thanks

On 11/14/2011 07:56 AM, address@hidden wrote:
> On Red Hat, the od command reverses the hex bytes.
> address@hidden PatientLoadDataFiles]$ cat a
> 123456
> address@hidden PatientLoadDataFiles]$ od -cx a
> 0000000   1   2   3   4   5   6  \n  \0
>         3231 3433 3635 000a
> 
> On HP-UX, it prints what you'd expect.
> plr02:lrxiusr:/plr02_users/lrxiusr/artdadamo> od -cx a
> 0000000    3132    3334    3536    0a00
>           1   2   3   4   5   6  \n
> 
> Is this a big-endian/little-endian issue?

Absolutely, which means it's not a bug, but a requirement by POSIX.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/od.html

If you want to output bytes in hex, then don't use the shorthand '-x'
(which is hardcoded to picking up machine-size short words, as in -tx2,
and thus exposes endianness issues), but instead use an explicit '-tx1'.

I'm closing this report.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]