#!/usr/bin/perl

use strict;
use Cwd qw(cwd);

my $dest = shift @ARGV;
my $doit = @ARGV ? shift @ARGV : 0;

die "CANNOT SEE DESTINATION $dest DIRECTORY!" unless -d $dest;
my $cwd = cwd();

while (<STDIN>) {
	my @p=split(/\s+/,$_,9);
	chomp($p[$#p]);
	next unless length($p[$#p]);
	my $t = $p[$#p];
	print "mv  $cwd/$p[$#p]   $dest/$t\n";
	if ($doit) {
		`mv  "$cwd/$p[$#p]"   "$dest/$t"`;
		print "                                DONE\n";
	}
}

