tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ lack of space & pipes

Those Damn Users' Caches Won't Go Away ... ▻

Those Damn Users' Caches Won't Go Away ...

In article <slrn8dhog5.era.dcoughlan@ophelia.fdi.net>,
Desmond Coughlan <dcoughlan@vdp.fr> wrote:
>LOCATION=USERS/DEFAULT/CACHE/

This line doesn't do anything useful: you set LOCATION again in the next
line.

>for LOCATION in `ls /home` ; do
>rm /home/$LOCATION/USERS/DEFAULT/CACHE/*
>   done

Does it produce any errors at all?  You might be running into argument
length limits, but the shell would complain about that.

(A common beginner's mistake is to "shut up" cron jobs by appending
`>/dev/null 2>&1'.  Needless to say, this is almost always a bad idea:
it makes it far too easy to break a script and not discover about it for
months afterwards.  It can be a bit more work to do something sensible
with the output, but it's well worth it in the long run.)

A couple of possible debugging techniques: i) use `sh -x' to see exactly
what commands are executed; ii) replace `rm' with `echo' to ensure that
your glob really does find the files you think it should.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: Those Damn Users' Caches Won't Go Away ...
Date: 23 Mar 2000 17:25:29 -0000
Message-ID: <8bdk2v$kve$1@ltpcg.star.le.ac.uk>
References: <slrn8dhog5.era.dcoughlan@ophelia.fdi.net>

△ comp.unix.shell △

◅ lack of space & pipes

Those Damn Users' Caches Won't Go Away ... ▻