tag 10045 notabug thanks On 11/14/2011 07:56 AM, adad...@us.imshealth.com wrote: > On Red Hat, the od command reverses the hex bytes. > [lrxdusr@cdtslrx122d PatientLoadDataFiles]$ cat a > 123456 > [lrxdusr@cdtslrx122d 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 ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature