> > Hi all, > > I am moving my users home directoires from one server to another and in > > the process standardising usernames such that about 300 need changing. > > Once I hav copied over the directories (cp -a) I will then need to rename > > some of the directories. I have a csv file with the format > > "oldname,newname" and a script to read it: > > > > #!/bin/bash > > while read name1 name2; do > > mv $name1 $name2 > > # done < /home/OLMC/snap/rename.txt
if none of the names contain any whitespace or comma characters, you can do the following: #!/bin/bash tr "," " " < /home/OLMC/snap/rename.txt | while read line; do mv $line done -- Vino Fernando Crescini [EMAIL PROTECTED] http://www.cit.uws.edu.au/~jcrescin Scanned by SCIT E-Mail Gateway http://www.cit.uws.edu.au -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
