home *** CD-ROM | disk | FTP | other *** search
- #!/usr/local/bin/perl
-
- die "Usage: $0 from to\n" unless ($#ARGV == 1);
- @ARGV = <@ARGV>;
-
- ($from, $to) = @ARGV;
-
- if (-d $to)
- {
- $leaf = $from;
- $leaf = substr($leaf, rindex($leaf, '.')+1) if ($leaf =~ /\./);
- $to = "$to.$leaf" if (-d $to);
- }
-
- if (-e $to)
- {
- printf("$0: Overwrite $to ? ");
- $_ = <STDIN>;
- if (/^[Yy]/)
- {
- system("wipe $to r~cf~v");
- }
- }
- exec("rename $from $to");
-