|
|
10.6: How much of Snow Leopard isn't yet 64-bit?
Unfortunately the previous one was still buggy. :-(
For non-universal binaries the file command outputs only a single line like this:/System/Library/Extensions/AppleEFIRuntime.kext/Contents/MacOS/AppleEFIRuntime: Mach-O object i386However, in case of a universal binary the "(for architecture ...)" section contains the real thing, since the "Mach-O object ..." section contains only the main architecture class. Eg. /System/Library/Extensions/TMSafetyNet.kext/Contents/MacOS/TMSafetyNet: Mach-O universal binary with 2 architecturesTaking this into account, here's a (hopefully now) correct one-liner:
file /System/Library/Extensions/*.kext/Contents/MacOS/* | awk '/Mach-O +[^ ]+ +[^ ]+$/ {if (match($0, "\\(for +architecture +")) { arch=substr($0, RSTART + RLENGTH); arch=substr(arch, 1, index(arch, ")")-1) } else { arch=$NF }; archs[arch]++; sub("( \\(for +architecture +[^ )]+\\))?:[^:]+Mach-O +[^ ]+ +[^ ]+$", ""); binaries[$0]=1 } END { total=0; for (bin in binaries) total++; print "total: " total; for (arch in archs) print arch ": " archs[arch] } '
It produces an output like this (on 10.5): total: 220And you can run it on /Applications/*.app/Contents/MacOS/* too and get a result like this: total: 127For the latter I should mention that I've already cleaned up /Applications with Xslimmer and Monolingual. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|