3 # $RCSfile: unvanish,v $$Revision: 4.1 $$Date: 92/08/07 17:20:52 $
7 chop($pwd = `pwd`) if $pwd eq '';
8 (chdir $olddir) || die "Directory $olddir is not accesible";
10 unless ($olddir eq '.deleted') {
12 chdir '.deleted' || die "Directory .deleted is not accesible";
15 chop($pwd = `pwd`) if $pwd eq '';
16 die "Directory .deleted does not exist" unless $pwd =~ /\.deleted$/;
19 print `mv $startfiles$filelist..$force`;
21 (chdir $pwd) || die "Can't get back to original directory $pwd: $!\n";
26 open(lastcmd,'.deleted/.lastcmd') ||
27 open(lastcmd,'.lastcmd') ||
28 die "No previous vanish in this dir";
31 @ARGV = split(/[\n ]+/,$ARGV);
34 while ($ARGV[0] =~ /^-/) {
36 /^-f/ && ($force = ' >/dev/null 2>&1');
37 /^-i/ && ($interactive = 1);
44 while ($file = shift) {
45 if ($file =~ s|^(.*)/||) {
52 if ($dir ne $olddir) {
58 print "unvanish: restore $dir/$file? ";
59 next unless <stdin> =~ /^y/i;
62 $filelist .= $file; $filelist .= ' ';