The key is to the type modifier that od is using. By default od uses a parameter something like this:
Looking at the man page, it tells us:
Quote:
o[SIZE]
octal, SIZE bytes per integer
SIZE is a number. For TYPE in doux, SIZE may also be C for sizeof(char), S for sizeof(short),
<snip>
|
Since the SIZE is a short, each two groups of characters in your example are being interpreted as a single octal number in the output, since the sizeof(short) on your Linux system is 2. If you'd like to see a 1-1 mapping between the output choose the size to be a char.
Code:
# echo aaaa | od -t oS
0000000 060541 060541 000012
0000005
# echo aaaa | od -t oC
0000000 141 141 141 141 012
0000005
The examples above show the output you were seeing on the top and one with char size input on the bottom. The 000000 and 0000005 are not part of your input, they are the starting address and the size of the input.
If you'd like to see the input interpreted as a 1:1 character output or as decimals choose these options respectively:
Code:
# echo aaaa | od -t a
0000000 a a a a nl
0000005
# echo aaaa | od -t dC
0000000 97 97 97 97 10
0000005
Hope this helps.