Unanswered: Copying Multiple filenames having whitespaces
I read a few posts on the topic of handling filenames with spaces but need some help on this one . I need to copy multiple files each of which have wihtespace to another direcotry .
for e.x i have a variable called cpfiles i.e
cpfiles="PSGIMG_1398_PSGMKT_IMG_FILENAME_2.0 Portable Mutli-Bur.gif" "PSGIMG_1398_PSGMKT_IMG_FILENAME_3.0 Portable Mutli-Bur.gif"
and in the next statement when i do
cp $cpfiles ./myimages ..
it simply fails stating
cp PSGIMG_1398_PSGMKT_IMG_FILENAME_2.0 .: File does not exist .
THis is mainly because of the Whitespace in the filesnames . How do I do it .. I have about 10,000 files like this to copy .
Any help would be appreciated.
Following is my script:
The list of images are in a file called images.list .. so it has about 10,000 lines
while read line
(( counter = counter + 1 ))
(( remainder = counter % IMAGECOPYCOUNTER))
if [ $remainder -eq 0 ];then
cp "$cpfiles" ./myimages
This is failing at the cp "$cpfiles" step when Images filenames have a space in them .
Any suggestions would be helpfull .