Writing bytes to stdout reverses the bytes

Grant Edwards grant.b.edwards at gmail.com
Mon Aug 20 10:16:46 EDT 2018


On 2018-08-20, Chris Angelico <rosuav at gmail.com> wrote:
> On Mon, Aug 20, 2018 at 12:01 PM, Grant Edwards
>> What do you mean "run it as hd"?
>>
[... Calling via 'hd' alias makes no difference ...]

> Your system is different from mine, then.

No doubt. :)

> rosuav at sikorsky:~$ ls -l $(which hd)
> lrwxrwxrwx 1 root root 7 Apr 12  2017 /usr/bin/hd -> hexdump
> rosuav at sikorsky:~$ ls -l $(which hexdump)
> -rwxr-xr-x 1 root root 27248 Apr 12  2017 /usr/bin/hexdump
>
> In 'man hexdump', the -C option says:
>      -C      Canonical hex+ASCII display.  Display the input offset in hexa‐
>              decimal, followed by sixteen space-separated, two column, hexa‐
>              decimal bytes, followed by the same sixteen bytes in %_p format
>              enclosed in ``|'' characters.
>
>              Calling the command hd implies this option.

$ hexdump --version
hexdump from util-linux 2.32

In 'man hexdump', the -C option says the exact same thing, but without
that last sentence.  The 'hd' alias implying -C seems to be a BSD
thing.  It's not mentioned in the official Linux hexdump man page:

  https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/text-utils/hexdump.1

But this page does mention 'hd':

  https://www.freebsd.org/cgi/man.cgi?query=hexdump&sektion=1

-- 
Grant Edwards               grant.b.edwards        Yow! I just forgot my whole
                                  at               philosophy of life!!!
                              gmail.com            




More information about the Python-list mailing list