Article View: uk.comp.os.linux
Article #693Re: Yet another crash!
From: Colin Smith
Date: Mon, 28 Feb 2000 00:00
Date: Mon, 28 Feb 2000 00:00
56 lines
3080 bytes
3080 bytes
On 28 Feb 2000 09:30:41 GMT, Dave Thorn <davet@tw2.com> wrote:
>On Tue, 22 Feb 2000 23:29:14 +0000, Colin Smith <colin@Yelm.freeserve.co.uk>
>wrote in message <slrn8b66u7.6us.colin@Orlanth.homenetwork>:
>>
>>Here's the shell code for 'del'.
>>------------------
>[snip code]
>>------------------
>
>
>that's nice. and to join it, here's a script to delete those entries
>after they've been sitting there for some time. add it to your
>crontab. No, it's not a one-liner, sorry. Doubtless this could be
Go on... I bet you could make it a one liner. :) You know you want to.
Rather than put it in a crontab, stick it in the /etc/profile or
better if you use bash, your ~/.bash_logout. That way on login
or logout it'll clean up behind the individual users. In X11,
stick it after the window manager in the .Xclient or .xsession
file so it gets run when you quit.
>written better (I'd cross-post to comp.lang.perl.misc if I really
>wanted it taken apart :). Usual disclaimers, no warranty, GPL'd, etc,
>etc.
>
>
>#!/usr/bin/perl -w
>use strict;
>
>my $TRASH_DIR = $ENV{HOME}.'/.trash';
>my $EXPIRY = shift || 7;
>
>opendir(DIR, $TRASH_DIR)
> or die "can't opendir '$TRASH_DIR': $!";
>
>my @files = grep {
> (-M "$TRASH_DIR/$_" > $EXPIRY) && (-f "$TRASH_DIR/$_")
>} readdir(DIR);
>
>foreach my $file (@files) {
> unlink "$TRASH_DIR/$file" or warn "Cannot unlink '$file': $!";
>}
>
>__END__
>
>
>--
>#include <disclaimer.h>
--
|Colin Smith: Colin.Smith@yelm.freeserve.co.uk | Windows 2000 |
|Linux: Delivers on the promises Microsoft make. | AKA |
| http://www.linux.org/ | The W2K Bug |
Technical Details
Message-ID:
<slrn8blv0n.200.colin@Orlanth.homenetwork>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<RJYW3.61$ju1.1566@nnrp4.clara.net> <FL3x5A.E5B@dangl.demon.co.uk> <383728e4@news.jakinternet.co.uk> <81rsh3$khi$1@fantasma.gsyc.inf.uc3m.es> <826a4r$mr5$1@sparky.wolfe.net> <385B6A68.838DAC06@r56o.f9.co.uk> <86fu3t$f29$1@news8.svr.pol.co.uk> <86g5dk$c5f$1@nnrp1.deja.com> <86io9q$nsv$1@newsg1.svr.pol.co.uk> <388E03F2.EA9A9682@netscape.net> <86lb70$meo$3@news5.svr.pol.co.uk> <388f2e8f.65436@news.greatxscape.net> <86nvkc$f11$1@news8.svr.pol.co.uk> <389091bc.2929952@news.greatxscape.net> <slrn899 <slrn8b3clu.7lu.phuae@primrose.csv.warwick.ac.uk> <slrn8b66u7.6us.colin@Orlanth.homenetwork> <slrn8bkg1g.et.davet@molochai.tw2.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111053,9e82041a3ad6a90 X-Google-Attributes: gid111053,public X-Google-Thread: 10d8ad,b33046ac4fb17395 X-Google-Attributes: gid10d8ad,public From: colin@Yelm.freeserve.co.uk (Colin Smith) Subject: Re: Yet another crash! Date: 2000/02/28 Message-ID: <slrn8blv0n.200.colin@Orlanth.homenetwork> X-Deja-AN: 591104702 References: <RJYW3.61$ju1.1566@nnrp4.clara.net> <FL3x5A.E5B@dangl.demon.co.uk> <383728e4@news.jakinternet.co.uk> <81rsh3$khi$1@fantasma.gsyc.inf.uc3m.es> <826a4r$mr5$1@sparky.wolfe.net> <385B6A68.838DAC06@r56o.f9.co.uk> <86fu3t$f29$1@news8.svr.pol.co.uk> <86g5dk$c5f$1@nnrp1.deja.com> <86io9q$nsv$1@newsg1.svr.pol.co.uk> <388E03F2.EA9A9682@netscape.net> <86lb70$meo$3@news5.svr.pol.co.uk> <388f2e8f.65436@news.greatxscape.net> <86nvkc$f11$1@news8.svr.pol.co.uk> <389091bc.2929952@news.greatxscape.net> <slrn899 <slrn8b3clu.7lu.phuae@primrose.csv.warwick.ac.uk> <slrn8b66u7.6us.colin@Orlanth.homenetwork> <slrn8bkg1g.et.davet@molochai.tw2.com> X-Complaints-To: abuse@theplanet.net X-Trace: news8.svr.pol.co.uk 951786335 15844 62.136.217.164 (29 Feb 2000 01:05:35 GMT) Organization: Customer of Planet Online User-Agent: slrn/0.9.6.2 (Linux) Reply-To: Colin.Smith@Yelm.freeserve.co.uk NNTP-Posting-Date: 29 Feb 2000 01:05:35 GMT Newsgroups: uk.comp.os.linux,freeserve.help.unix