Well i think you need to create the dir's first then...
you could do something like this in a script i guess:
for i in $(find $path -iname $pattern); do
current_dir=$(echo $i | sed -e "s/^\(.*\)\/[A-Za-z0-9.]*$/\1/")
[ -d $current_dir ] || mkdir -p $current_dir
cp $i $to_path/
This should create all directories and copy all files found in $path where $pattern matches
(ps. It's untested since I don't have anything to test it with
Hmm... I did have something to test it with
... but I get all these errors...
mkdir: `/home/james/google-breakpad/google-breakpad-read-only/src/client/minidump_file_writer-inl.h' exists but is not a directory
mkdir: `/home/james/google-breakpad/google-breakpad-read-only/src/client/minidump_file_writer.h' exists but is not a directory
mkdir: `/home/james/google-breakpad/google-breakpad-read-only/src/http_upload/include/http_upload.h' exists but is not a directory
Anyway if you know how to fix it, I would appreciated.