On 22.08.2023 15:58,
[email protected] wrote:
See my following example:
werner@X10DAi:~$ echo -n -e "\x12\x34\x56\x78" | od -An -x --endian=big
1234 5678
werner@X10DAi:~$ echo -n -e "\x12\x34\x56\x78" | od -An -x --endian=little
3412 7856
(My 'od' doesn't support '--endian'; I use different options below
and show only the little-endian results.)
Could you tell me why the latter doesn't give the following result?
Endian-ness swaps bytes in "words" (default "word" is 2 octets; you
define what a "word" is).
$ echo -n -e $'\x12\x34\x56\x78' | od -An -t x1
12 34 56 78
$ echo -n -e $'\x12\x34\x56\x78' | od -An -t x2
3412 7856
$ echo -n -e $'\x12\x34\x56\x78' | od -An -t x4
78563412
$ echo -n -e $'\x12\x34\x56\x78\x90\xab' | od -An -t x8
0000ab9078563412
Janis
7856 3412,
aka,
0x78 0x56 0x34 0x12
Regards,
Zhao
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)