Hi,  I just spent a few hours learning how to find files and got a cp
command up that looked like it should work..

I ran into a problem that was very tough to find the solution to though,

cp: with --parents, the destination must be a directory
Try `cp --help' for more information.

I have since found a promising lead that suggested using the dirname
command to solve my problem.. hours later that I wish I knew that.

anyway, is there some drastic reason why --parents doesn't work with a
full filename with filname and path?

btw, I need the paths

-T --parents seems like it should make it write to a file...


#!/bin/bash
DESTDIR="/media/disk/highpriority"

find -maxdepth 2 -type f -name '*' | while read line; do
DESTtail=`echo "$line" | cut -c 2-` ;
#echo cp -v "$line" "$DESTDIR$DESTtail";
cp -T --parents -v "$line" "$DESTDIR$DESTtail";
done


Thanks.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to