Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tlug: clearing Netscape's cache



Hi all,

I got an interesting csh tip about how to clear Netscape's cache on logout but
couldn't get it to work for me. So, I tried a bash solution which works, but
isn't really there yet.

Here's the original tip:

------------------- CUT HERE ------------------------------
#!/bin/csh

if !( `ps -eu $USER | grep netscape | grep -v grep | sed -e 's/^  *//' -e 's/
.*//'` ) then
        echo
        echo "Clearing Netscape cache..."
        \rm -rf ~/.netscape/cache/*
endif

echo
echo "Exiting..."

------------------- CUT HERE ------------------------------

as I said, it didn't work for me. I came up with:

schweiz:~/bin$ cat rmcache 

----Jim's hack-------------------------------
#!/bin/sh
if 
ps -aux  | grep $USER/hdd/netscape/netscape 
then
echo "Shut down netscape 3.0 first."
elif
ps -aux  | grep $USER/hdd/nav403/netscape 
then
echo "Shut down netscape 4.03 first."
else
echo
echo "Clearing Netscape cache..."
rm -rf ~/.netscape/cache/*
rm -rf ~/.netscape/archive/*
echo
echo "running df"
echo
df
echo
fi
-------end Jim's hack------------------------

The problems I'm having are:

1. I run multiple versions of netscape - 2.02, 3.0 and 4.03
and
2. caching is in ~/.netscape/cache and ~/.netscape/archive

The above script works, but it's not elegant. How do I use ps to find out which
versions of netscape are running (and by which user) without using a path? If I
try:

ps -aux | grep $USER*netscape

it, of course, dies since ps returns *netscape and exits. I'm not worried about
the logout part .... but, as always, I'm curious....

Jim S.


Next TLUG meeting is Saturday Dec. 13, 1997  (possibly Nov. 13?)
---------------------------------------------------------------
a word from the sponsor:
TWICS - Japan's First Public-Access Internet System
www.twics.com  info@example.com  Tel:03-3351-5977  Fax:03-3353-6096



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links