Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: How much of Snow Leopard isn't yet 64-bit?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: How much of Snow Leopard isn't yet 64-bit?
Authored by: dbingham on Sep 18, '09 06:34:15PM
Wow...this is entirely wrong. It counts each architecture in a universal binary as a different entry.

If you really want to know how many of your kext's are able to run x86_64, how many will only do i386 and how many are only ppc, try this:

oifs=$IFS&&IFS=$'\n'&&i=0&&x=0&&p=0&&for f in $(ls /System/Library/Extensions/*.kext/Contents/MacOS/*);do if [ $(file $f | grep -i x86_64 | wc -l) -gt 0 ];then x=$((x+1));elif [ $(file $f | grep -i i386 | wc -l) -gt 0 ];then i=$((i+1));else p=$((p+1));fi;done&&echo "$x x86_64"&&echo "$i i386"&&echo "$p ppc"&&IFS=$oifs
Which in more readable form is:

oifs=$IFS &&
IFS=$'\n' &&
i=0 &&
x=0 &&
p=0 &&
for f in $(ls /System/Library/Extensions/*.kext/Contents/MacOS/*); 
do 
  if [ $(file $f | grep -i x86_64 | wc -l) -gt 0 ]; 
  then 
    x=$((x+1)); 
  elif [ $(file $f | grep -i i386 | wc -l) -gt 0 ]; 
  then 
    i=$((i+1));
  else 
    p=$((p+1));
  fi;
done &&
echo "$x x86_64" &&
echo "$i i386" &&
echo "$p ppc" &&
IFS=$oifs
And the total of those three lines of output should equal:

ls /System/Library/Extensions/*.kext/Contents/MacOS/* | wc -l
-dbingham

[ Reply to This | # ]