The script, in and of its self, is fairly self-explanatory. Can this script be further improved?
First iteration was writ upon OS X 10.5.8 Leopard, current iteration was run upon OS X 10.6.4 Snow Leopard with Safari 5.0.2 (6533.18.5). Also, any illumination as to why the first line ' if [ -f ] ' works, but ' if [ -f ~/Library/Safari/LocalStorage/*.localstorage ] ' generates an error? [yes, I am a bit of a Noob]
Code:
#! /bin/bash
# SafariClear0.0.6
if [ -f ]
then
cat /dev/null > ~/Library/Safari/LocalStorage/*.localstorage
rm -f ~/Library/Safari/LocalStorage/*.localstorage
fi
if [ -f ~/Library/Safari/LocalStorage/*.localstorage ]
then
echo "Oy vey!"
fi
cd ~/Library/Safari/
cat /dev/null > WebpageIcons.db
cat /dev/null > TopSites.plist
cat /dev/null > LocationPermissions.plist
cat /dev/null > LastSession.plist
cat /dev/null > History.plist
echo "Clear"
exit
-f ~/…/*.localstorage
will expand the wildcard to the file names of alllocalstorage
files that exist, which-f
can't test. You'd need to do that one at a time. I don't see the point of that statement though if all you do isecho "Oy vey"
... So, what exactly do you want to do and where are you stuck? What doesn't work?