Re: Scripting names from a file

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

 



On Tuesday 28 September 2004 16:41, Filippos Klironomos wrote:
> > Lets say for example I have a text file with one name on each line and I
> > need to create files based on the names in that file, If I can use a for
> > loop it would be greate, but I don't know how to get each name from the
> > file,
>
> You don't need a script for that. Something simple as:
>
> cat file_with_filenames | xargs touch
>
> will just create those filenames in the file file_with_filenames but
> of course they will have zero size. So you have to be more specific on
> what you want to do with those file names.
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 `

Thanks
-- 
Chadley Wilson
Redhat Certified Technician 
Cert Number: 603004708291270
Pinnacle Micro
Manufacturers of Proline Computers
====================================
Exercise freedom, Use LINUX
=====================================


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

  Powered by Linux