I need a way to tell what mode the shell is in from within the shell.
While I\'m primarily an OS X user, I\'d be interested in knowing about other platforms as well.<
Basically a variant on Matthew Marshall's answer (with struct from the std.library):
import struct print struct.calcsize("P") * 8