Le mar 19/08/2003 � 13:49, Yves Rutschle a �crit :
> On Tue, Aug 19, 2003 at 12:42:21PM +0100, Nicolas Rueff wrote:
> > �a expliquerait pourquoi recover marche moyennement chez moi. Bon, je
> > vais me bricoler un rm custom, moi
>
> Si �a interesse des gens:
>
>
> #! /usr/bin/perl
>
> mkdir "/tmp/removed" unless -d "/tmp/removed";
>
> foreach ( @ARGV ) {
> next if not -e $_;
> s/\/$//;
>
> if ( s/(.*)\/// ) {
> chdir $1;
> }
>
> my $move_to = "/tmp/removed/$_.1";
> if ( -e "$move_to" ) {
> $move_to =~ s/(\d+)$/$1+1/e;
> }
> print "mv $_ $move_to\n";
> `mv $_ $move_to`;
> }
>
>
> que je mets dans ~/bin/del, puis alias rm="del". �a garde
> tous les fichiers et r�pertoires avec un num�ro de s�rie (si
> on efface 5 fichiers toto, on se retrouve avec
> /tmp/removed/toto.1 toto.2 ...) On combine �a avec
> tmpreaper. C'est pas particuli�rement evolu�, mais �a
> marche.Non, je pensais plut�t � une solution g�rant la taille de la poubelle. J'ai d�j� une version en bash, mais comme bash g�re assez mal les espaces dans les noms, je vais bient�t le convertir en perl ;) /N ______________________________________________________________________ Nicolas Rueff <[EMAIL PROTECTED]> http://rueff.tuxfamily.org +33 6 77 64 44 80 -- There once was a man who went to a computer trade show. Each day as he entered, the man told the guard at the door: "I am a great thief, renowned for my feats of shoplifting. Be forewarned, for this trade show shall not escape unplundered." This speech disturbed the guard greatly, because there were millions of dollars of computer equipment inside, so he watched the man carefully. But the man merely wandered from booth to booth, humming quietly to himself. When the man left, the guard took him aside and searched his clothes, but nothing was to be found. On the next day of the trade show, the man returned and chided the guard saying: "I escaped with a vast booty yesterday, but today will be even better." So the guard watched him ever more closely, but to no avail. On the final day of the trade show, the guard could restrain his curiosity no longer. "Sir Thief," he said, "I am so perplexed, I cannot live in peace. Please enlighten me. What is it that you are stealing?" The man smiled. "I am stealing ideas," he said. -- Geoffrey James, "The Tao of Programming" ______________________________________________________________________
signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=

