#!/usr/bin/perl -w use strict; use File::Copy qw(copy); die("Usage: $0 \n") unless($#ARGV==1); -d or die("$_ is not a directory") for(@ARGV); s/\/$// for(@ARGV); for(glob("$ARGV[0]/*"),glob("$ARGV[1]/*")) { copy("$ARGV[0]/$_","$ARGV[1]/$_") or warn("$!: $ARGV[0]/$_\n") if(s/$ARGV[0]// && -f "$ARGV[0]/$_" && !-e "$ARGV[1]/$_"); unlink("$ARGV[1]/$_") or warn("$! unlinking $ARGV[1]/$_\n") if(s/$ARGV[1]// && -f "$ARGV[1]/$_" && !-e "$ARGV[0]/$_" ); } #### /****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/