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

Writing bytes to stdout reverses the bytes

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:


But this page does mention 'hd':


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