Friday, July 6, 2012

Endianness

bash
echo I | tr -d [:space:] | od -to2 | head -n1 | awk '{print $2}' | cut -c6
returns 1 on little-endian machine



python
python -c "import sys;print(sys.byteorder)"
prints little or big

No comments: