|
|
#1 |
|
Prospect
Join Date: Jul 2008
Posts: 6
|
Determine PPC or Intel with ShellScipt
So, I have a /bin/sh shell scrip, and if the computer is a PPC-based one, I want it to execute one terminal command; but if the computer is Intel I want to execute a different terminal command
|
|
|
|
|
|
#2 |
|
League Commissioner
Join Date: Mar 2003
Location: Kansas City
Posts: 11,347
|
Code:
#!/bin/sh x86=`system_profiler SPHardwareDataType | grep Intel -c` if [[ $x86 == 1 ]] then <insert intel command> else <insert PPC commands> fi done exit
__________________
sudo make me a sammich http://www.tlarkin.com "It just told me what I already knew, that I'm a great and amazing guy, didn't I tell you baby, I'm Zaphod Beeblebrox." |
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jul 2008
Posts: 6
|
thanks :-)
|
|
|
|
|
|
#4 |
|
League Commissioner
Join Date: Mar 2003
Location: Kansas City
Posts: 11,347
|
did it work?
__________________
sudo make me a sammich http://www.tlarkin.com "It just told me what I already knew, that I'm a great and amazing guy, didn't I tell you baby, I'm Zaphod Beeblebrox." |
|
|
|
|
|
#5 |
|
MVP
Join Date: Jun 2007
Location: Skellefteċ, Sweden
Posts: 1,173
|
Or even:
uname -p answers i386 for me but test and see what you get on other machines.
__________________
/Bengt-Arne Fjellner IT-Administrator Luleċ university, Sweden. Some say: "You learn as long as you live". My way: "You live as long as you learn". |
|
|
|
|
|
#6 | |||||||||||||||||||||||
|
Moderator
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,550
|
Code:
% uname -p powerpc Trevor
__________________
How to ask questions the smart way |
|||||||||||||||||||||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|