Post not yet marked as solved
Post marked as unsolved with 1 replies, 506 views
macOS's od command fails to display 64-bit signed integers correctly. Compare the outputs from the native od command and from the GNU od command below. The command shows no error messages. The man page of the native od indicates that it supports -t d8 .
The binary file is a list of 64-bit integers, increasing from 0 by 1: 0, 1, 2, 3, . . . and the od -x correctly shows that (not shown here).
What am I missing? It's hard to believe that such a basic command includes such an obvious bug, if it really is a bug, that is.
macOS 13.3.1, mac mini (2023).
Here is the comparison. The native od seems to interpret the sequence of bytes as if it were 8-bit int, ignore, ignore, ignore, 8-bit int, ignore, ignore, ignore, . . . (Note that the disk image is little endian.) (I've shortened some of the lines as there were too many blanks per line.)
~/tmp $ /usr/bin/od -t d8 tmp.bin | head -70 | tail -10
0001700 120 121
0001720 122 123
0001740 124 125
0001760 126 127
0002000 -128 -127
0002020 -126 -125
0002040 -124 -123
0002060 -122 -121
0002100 -120 -119
0002120 -118 -117
~/tmp $ god -t d8 tmp.bin | head -70 | tail -10
0001700 120 121
0001720 122 123
0001740 124 125
0001760 126 127
0002000 128 129
0002020 130 131
0002040 132 133
0002060 134 135
0002100 136 137
0002120 138 139