Monday, February 23, 2015

Check endianity

echo -n I | od -to2 | awk '{ print substr($2,6,1); exit}'
or 
echo -n I | hexdump -o | awk '{ print substr($2,6,1); exit}'

will give 1 for little endian

http://serverfault.com/questions/163487/linux-how-to-tell-if-system-is-big-endian-or-little-endian

No comments:

Post a Comment