Created
November 10, 2016 20:52
-
-
Save jrelo/65bb8844ffb0b043e5516e82755c2d25 to your computer and use it in GitHub Desktop.
test endianness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ `echo -n I | od -to2 | head -n1 | cut -f2 -d" " | cut -c6` -ne 1 ]]; then echo "big endian";else echo "little endian";fi | |
python -c "import struct; print 'little endian' if ord(struct.pack('L', 1)[0]) else 'big endian'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment