The easy way to accomplish your task is
Code:
#!/bin/bash
cp -i $(cat inputfile) dirname
using command substitution as in the example above will result in a list of files separated by spaces, since in this way the shell strips out the newline characters. The resulting command syntax is valid, provided the last argument is the name of an existing directory.
The hard way, following your example is
Code:
exec 8< inputfile
while read -u8 line
do
cp -i $line copy
done
exec 8<&-
This will associate the input file to file descriptor 8 and the read statement will accept input from this file descriptor through option -u. In this way the standard input remains associated to the terminal. Also notice that the -i option of the cp command ask confirmation before overwriting a file only, not for each file to copy.
For other uses take in mind you can restore standard input from the terminal using
exec < /dev/tty but in your case the while loop would have stopped its execution, having lost connection to the input file.