vick Julius wrote: > Hello everybody > > I want to rename files with the new names from a text file, names.txt: > > Brazilian coffee > Canadian maple > Korean car > > i want to use the following script As Rick mentioned, you will end up with only the one file. > I want to renmae all files (in *.doc) with the new names read from > names.txt file. > > The problem is the names in the file names.txt have spaces... The only way I can think of is you will need to use an array to hold the file names, see 'man bash' search for Arrays. I think Perl would be more like you friend here, or C if you can. Another thing, spaces in *nix files just cause havoc; you would save yourself a lot of future grief if you replaced the spaces with an underscore "blah_blah" or something. Maybe you can do something to this effect: while looping through the names.txt file, do a 'ls *.doc' and mv the first file to newname.blah, ignoring the rest. I don't know how you could do that, off hand, just a thought, I still think an array would be easier. =P -- Scott - : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html