[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: host endianness
On Mon, Feb 08, 2010 at 09:44:35AM +0200, Alan Barrett wrote:
> > echo -n 'C!' | od -h | sed 's/[^1234]*//;s/2143/4321/p;d'
> Host shells might not support "echo -n", so please use printf "%s" "C!"
Why not just printf "C!"? However,
echo 'C!' | od -N 2 -h | sed 's/[^1234]*//;s/2143/4321/p;d'
is somewhat tidier.
> Also, the above assumes an ascii-compatible environment on the
> cross-build host, and I don't know whether other parts of the build
> already assume that.
I suppose that calls for
printf '\x43\x21' | od -h | sed 's/[^1234]*//;s/2143/4321/p;d'
although I doubt that very much will work on a non-ascii host. Might
be amusing to try if anyone has one though...
David A. Holland
Main Index |
Thread Index |