Re: shell script question:How 2 assign several fields from a file to a variable?

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

 



Hint: Use sed to remove spaces from names.txt first.

--Adrian.

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

for i in *.doc
do

   for file in `cat names.txt`
  do
   mv  $i   $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...


Any idea?

Thanks

Vick

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-
: 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


-
: 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

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux