[SOLVED] Need Help With Bash Script - CPU if else
Hi Guys,
I wondered if someone could help me with my nearly completed bas script. The problem is that if/else does not work properly. Basically it should detect which cpu is used (intel or ppc) and with that info do the if/else.
The command uname -p, if used on a Mac, will either output i386 for Intel and powerpc for PPC macs. The if part of the script is for the Intel (i386) and the else part is for PPC (powerpc).
Right now the script does not work. Help is greatly appreciated!
#!/bin/sh
uname -p
a=$?
if test "$a" = "0";
then
pushd ~/Desktop; curl -C - -O http://fpdownload.macromedia.com/get...sx_ub.dmg.zip; popd
pushd ~/Desktop; unzip install_flash_player_osx_ub.dmg.zip -d ~/Desktop/ && rm -r __MACOSX; popd
pushd ~/Desktop; open /Users/180it/Desktop/Install\ Flash\ Player\ 9\ UB.dmg; popd
rm ~/Desktop/install_flash_player_osx_ub.dmg.zip
else
pushd ~/Desktop; curl -O http://fpdownload.macromedia.com/get...layer_osx.dmg; popd
pushd ~/Desktop; open install_flash_player_osx.dmg; popd
fi
Last edited by OffHand; September 3rd, 2008 at 02:03 PM.
"I'd rather be hated for what I am, than loved for what I'm not."
Bookmarks