coreutils
[Top][All Lists]
Advanced

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

Re: bug#41518: Bug in od?


From: Pádraig Brady
Subject: Re: bug#41518: Bug in od?
Date: Mon, 25 May 2020 11:48:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Thunderbird/76.0

tag 41518 notabug
close 41518
stop

response below...

On 25/05/2020 04:05, Yuan Cao wrote:
Hello,

I recently came across the following behavior.

When using "--traditional x2" or "-x" option, it seems the order of hex
code output for the characters is pairwise reversed (if that's the correct
way of describing it).

For example, using "od -cx" on a test file that contains "123456789\n", you
get the following output:

0000000   1   2   3   4   5   6   7   8   9   0  \n
                  3231  3433  3635  3837  3039  000a
0000013

It seems like it should be the following instead:

0000000   1   2   3   4   5   6   7   8   9   0  \n
                  3132  3334  3536  3738  3930  0a00
0000013

The version involved is od in GNU coreutils 8.28.

That's because you're on a little endian machine.
If you want to reorder as per a big endian machine you can:

  od --endian=big -cx your_file

If you want to hexdump independently of endianess you can:

  od -Ax -tx1z -v

cheers,
Pádraig



reply via email to

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