Re: Scripting names from a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chadley Wilson wrote:
OK Maybe I am trying to be too clever in my simplification of the senario, so maybe this helps:
I have a directory with files in it, I also have a text file with a list of certian files, I need to mv the files listed in the text files out of the dir into a new dir which I have created.
Does that make more sense?


So basically I am after something like this
for i in `each_name_in_file ` ; do
mv $1 /dest/dir
done


The bit I can't workout is `each_name_in_file `

for i in `cat file_with_filenames`; do mv $i /dest/dir done

This may break if the filenames have unusual characters in them, like shell metacharacters or spaces.

Paul.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux