Bash mine script, please

Posted by HomelyPoet on Super User See other posts from Super User or by HomelyPoet
Published on 2012-06-21T20:31:45Z Indexed on 2012/06/21 21:18 UTC
Read the original article Hit count: 508

Filed under:
|
|
|
|

The script, in and of its self, is fairly self-explanatory. Use if You so desire; any and all criticism wouldst be appreciated, as wouldst any suggestions for improvement. 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

© Super User or respective owner

Related posts about osx

Related posts about bash