# $Header: findcp,v 4.0 91/03/20 01:09:37 lwall Locked $
# This is a wrapper around the find command that pretends find has a switch
# of the form -cp host:destination. It presumes your find implements -ls.
# It uses tar to do the actual copy. If your tar knows about the I switch
# you may prefer to use findtar, since this one has to do the tar in batches.
`tar cf - $list | rsh $desthost cd $destdir '&&' tar xBpf -`;
if ($sourcedir =~ /^\//) {
unless (chdir($sourcedir)) { die "Can't find directory $sourcedir: $!"; }
if ($args =~ s/-cp *([^ ]+)/-ls/) {
if ($dest =~ /(.*):(.*)/) {
die "Malformed destination--should be host:directory";
die("No destination specified");
open(find
,"find $args |") || die "Can't run find for you: $!";
if ($x[2] =~ /^d/) { next;}
chop($filename = $x[10]);
if (length($list) > 5000) {