#!/bin/bash if [ $(echo -n I | od -to2 | head -n1 | cut -f2 -d" " | cut -c6) ]; then echo "Little endian"; else echo "Big endian"; fi