find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following:

I have a list of filenames:
A01_155716
A05_155780
A07_155812
A09_155844
A11_155876

that are kept in different sub directories within my current directory. I want to find these files and copy them into another new directory.
I was trying to use this command:
find . -name $items -exec cp '{}' new_dir\;
but i don't know how to include the list of names within this command.

thanks
Manisha

One way:

cat filenames.list | \
while read FILENAME
do
  find . -name "$FILENAME" -exec cp '{}' new_dir\;
done

Hi,

Thanks for sending me this code. I ran it but I get the error message:

test.sh: line 6: syntax error near unexpected token `done'
test.sh: line 6: `done

what should I do?

thanks again
Manisha

The following will do what you asked:

cat file.lst | while read FILENAME; \
do find  -wholename "*$FILENAME" -type f -print -exec cp '{}' new_dir \; ; done;

If you do this, it will copy anything that is not a directory including special devices.

cat file.lst | while read FILENAME; \
do find  -wholename "*$FILENAME"  ! -type d -print -exec cp '{}' new_dir \; ; done;