I was recently building some preflight scripts and was looking to record some information about a machine live, before proceeding with a script. I found the cheapest way to determine information about architectures and chipsets when scripting preflight scripts for OS X to be the arch and machine commands respectively. For example, to verify the architecture is i386, use the arch command with no options:
/usr/bin/arch
Which simply outputs “i386”:
i386
To check the machine type, simply use the machine command:
/usr/bin/machine
Which outputs as follows:
x86_64h