fredrik.eriksson wrote:
Well i think you need to create the dir's first then...
you could do something like this in a script i guess:
Code:
#!/bin/bash
path=$1
pattern=$2
to_path=$3
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/
done
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

ds.
Best regards
Fredrik Eriksson
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.