kay's perl branch

This commit is contained in:
Jeff Hill
1997-04-11 20:44:03 +00:00
parent 8d6deea83d
commit 8013fecb61
24 changed files with 1981 additions and 126 deletions

32
src/tools/rm.pl Normal file
View File

@@ -0,0 +1,32 @@
#!/usr/local/bin/perl
#
# UNIX-rm in Perl
use File::Path;
use File::Find;
use Getopt::Std;
getopt();
foreach $arg ( @ARGV )
{
next unless -e $arg;
if (-d $arg)
{
if ($opt_r and $opt_f)
{
rmtree $arg;
}
else
{
rmdir ($arg) or die "Cannot delete $arg";
}
}
else
{
unlink ($arg) or die "Cannot delete $arg";
}
}
# EOF rm.pl