#!/usr/bin/perl -w use strict; use vars qw($temp $read); $temp=$ARGV[0]; if($temp = $ARGV[0]){ &go } else { &err } ######## sub go { ######## print "\nDo you want to remove this file completely? Or Put it in a tem +p dir?\n"; print "(c for Completely t to Archive):"; chomp($read=<STDIN>); if($read =~ m/^[tT]/){ system("mv", "$temp","/var/tmp/deftemp") | +| warn "Error : $!" } else { &go2 } } ######### sub go2 { ######### if($read =~ m/^[cC]/){ system("rm","-R", "$temp") } else { &err } } ######### sub err { ######### print "Invalid Input!\n"; } exit 0;
option, but I thought it would be fun to do it in Perl.rm -i
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Oops I did it again.....
by mrbbking (Hermit) on May 12, 2002 at 17:06 UTC | |
by Anonymous Monk on May 12, 2002 at 19:53 UTC | |
by defyance (Curate) on May 13, 2002 at 02:02 UTC | |
|
Re: ( Move or Delete Files )
by Zaxo (Archbishop) on May 12, 2002 at 20:36 UTC | |
by defyance (Curate) on May 13, 2002 at 01:59 UTC | |
by Kanji (Parson) on May 13, 2002 at 02:08 UTC | |
by defyance (Curate) on May 13, 2002 at 02:23 UTC |