Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Determining the length of "long"?



Is there a way to determine the length of the C type long from
inside a zsh script (without using external programs, of course).

As an alternative, is there a direct way to print out a "long"
integer value as binary bytes in host byte order?

I.e. given a value, say 0x12345, I need to print that as

  \\x00\\x01\\x23\\x45

on a 32 bit platform, and as

  \\x00\\x00\\x00\\x00\\x00\\x01\\x23\\x45

on a 64 bit platform (possibly in reverse byte order, depending on
the hardware).

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt




Messages sorted by: Reverse Date, Date, Thread, Author