Package: coreutils
Version: 5.2.1-21

Here's the start of the od man page:

OD(1)                            User Commands                           OD(1)

NAME
       od - dump files in octal and other formats

SYNOPSIS
       od [OPTION]... [FILE]...
       od --traditional [FILE] [[+]OFFSET [[+]LABEL]]

DESCRIPTION
       Write an unambiguous representation, octal bytes by default, of FILE to
       standard output.  With more than one FILE argument, concatenate them in
       the  listed  order to form the input.  With no FILE, or when FILE is -,
       read standard input.
       [snip]
od (coreutils) 5.2.1            September 2005                           OD(1)
---------------------------------------------------------------------------
Now here's my test file: abcdefg

%od test gives:
0000000 061141 062143 063145 005147
0000010
%od -x test gives:
0000000 6261 6463 6665 0a67
0000010
%od -c test gives:                              //OK
0000000   a   b   c   d   e   f   g  \n
0000010
%hd test gives:                                 //OK
00000000  61 62 63 64 65 66 67 0a                           |abcdefg.|
00000008
-----------------------------------------------------------------------------
While the man says that od gives a representation of the bytes, the
first test only shows the values of the 2-byte words in octal.

The next test shows the values of the same words in hexadecimal.  Note
that that the value of the word is the value you get by swapping
bytes.  a b becomes b a, etc.  Checking the output of the first
example shows that it too has been byte-swapped.

The last 2 examples are OK.  The last example is for a different program
hd (hex-dump) which is outputting correctly.

Sure, od outputs the correct values of the words since the architecture
of the computer (actually of the Pentium CPU) is little endian (least
significant byte first).  But od is supposed to report byte values,
not word values.

                        David Lawyer



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to