I'm writing a shell script, and I need to know the architecture, i.e. PPC or Intel. Back in the day, there was a program /bin/arch that told you, but my mac doesn't seem to have it... Is there an easy way I can do this? Grep for something in a logfile? call some other program that spits that out as a side effect?

It would be nice to know what OS Version I'm running too, but that may not be necessary.

thanks

link|improve this question

45% accept rate
feedback

3 Answers

up vote 2 down vote accepted

There are many ways, but try uname -a.

link|improve this answer
2  
uname -p gives just the processor architecture. man uname for other options. – Doug Harris Jun 3 '10 at 16:55
feedback

arch is available in /usr/bin/arch

You can get OS version information with sw_vers

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.6.3
BuildVersion:   10D573
$ sw_vers -productVersion
10.6.3
link|improve this answer
feedback

uname -m seems to output the same information as /bin/arch.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.