3 # $RCSfile: vanish,v $$Revision: 4.1 $$Date: 92/08/07 17:20:54 $
7 chop($pwd = `pwd`) if $pwd eq '';
8 (chdir $olddir) || die "Directory $olddir is not accesible";
11 print `mkdir .deleted; chmod 775 .deleted`;
12 die "You can't remove files from $olddir" if $?;
15 $filelist =~ s/#/\\#/g;
16 if ($filelist !~ /^[ \t]*$/) {
17 open(lastcmd,'>.deleted/.lastcmd');
18 print lastcmd $filelist,"\n";
20 print `/bin/mv $startfiles$filelist .deleted$force`;
23 (chdir $pwd) || die "Can't get back to original directory $pwd: $!\n";
27 while ($ARGV[0] =~ /^-/) {
29 /^-f/ && ($force = ' >/dev/null 2>&1');
30 /^-i/ && ($interactive = 1);
39 while ($file = shift) {
40 if ($file =~ s|^(.*)/||) {
48 print "vanish: remove $dir/$file? ";
49 next unless <stdin> =~ /^y/i;
52 if ($file eq '.deleted') {
53 print stderr "To delete .deleted (the trashcan) use the 'empty' command.\n";
57 if ($dir ne $olddir) {
62 $filelist .= $file; $filelist .= ' ';