04.26.07

Killing Time

Posted in random, Apple, Technology, Coding, OS X at 4:57 pm by keynesiandreamer

So I am waiting for a nice long File Maker Query and happend to see and interesting bit of code while troubleshooting a printer driver installer that decided not to work:

##################################################
# Cleanup cache
##################################################

if(”$OS_VERSION” < 1030) then
### Jaguar ###
set IsQuiet = 0
while ($IsQuiet == 0)
set PROCESS = (`ps ax | grep ‘Print Center.app’ | grep -v grep`)
if ($#PROCESS == 0) then
set IsQuiet = 1
else
kill -9 “$PROCESS[1]”
endif
end
rm -f ~/Library/Preferences/ByHost/com.apple.print.PrintCenter.*.plist

else
### Panther ###
set IsQuiet = 0
while ($IsQuiet == 0)
set PROCESS = (`ps ax | grep ‘Printer Setup Utility.app’ | grep -v grep`)
if ($#PROCESS == 0) then
set IsQuiet = 1
else
kill -9 “$PROCESS[1]”
endif
end
rm -f /Users/*/Library/Preferences/ByHost/com.apple.print.Cache.*.plist
rm -f /var/root/Library/Preferences/ByHost/com.apple.print.Cache.*.plist
endif

set EXTENSION_MODULES = (`egrep ‘/System/Library/Extensions’ “$0:h”‘/BundleVersions.plist’` )
if($#EXTENSION_MODULES) then
rm -f ‘/System/Library/Extensions.kextcache’
rm -f ‘/System/Library/Extensions.mkext’

egrep ‘/System/Library/Extensions/BJUSBLoad.kext’ “$0:h”‘/BundleVersions.plist’ >& /dev/null
if ($status == 0) then
kextload /System/Library/Extensions/BJUSBLoad.kext
sleep 3
endif
endif

While for others this may not be interesting, it showed some of the fundamental changes in OS X, namely between 10.2 and 10.3, which it looks like 10.4 is complicit with. This was written as shell script in the tcsh (thats the “T-Shell” right?). In any maybe someone else will find in interesting as well. Here is the file in its entirety to view in the ext editor of your choice.

Piece of the Canon iP4200 Driver installer

Well, back to work…

Leave a Comment