I am trying to take a list of filenames and copy those files from one directory into another. Is there a way I can do a 'more' of the file with the filenames and redirect or pipe the output into a 'cp' command. I am using a bash shell. I apologise in advance for what is probably a very simple question.
Is this what you want?
[wayne@UW-GOODRICHWE ~]$ find script -type f
script/testweb.sh
script/changedate.sh
script/rootchk
script/rkhunt.sh
script/testargs.sh
script/test-curl.sh
script/move-capp.sh
[wayne@UW-GOODRICHWE ~]$ find script -type f >> list
[wayne@UW-GOODRICHWE ~]$ cat list
script/testweb.sh
script/changedate.sh
script/rootchk
script/rkhunt.sh
script/testargs.sh
script/test-curl.sh
script/move-capp.sh
[wayne@UW-GOODRICHWE ~]$ mkdir temp
[wayne@UW-GOODRICHWE ~]$ for i in `cat list`; do cp $i temp; done
[wayne@UW-GOODRICHWE ~]$ ls temp
changedate.sh rkhunt.sh testargs.sh testweb.sh
move-capp.sh rootchk test-curl.sh
[wayne@UW-GOODRICHWE ~]$
That is exactly what I was after.