bash + concatenate + scripting

Jandre Olivier <[email protected]> Fri, 02 Jul 2004 12:48:31 +0200
Newsgroups gmane.linux.admin.managers
Message-ID <[email protected]>
Hi Guys,

I know this is a bit off from every post, but most linux managers can 
script, so i hope its not a problem

i have a new mail server configured with vpopmail for our little isp, 
and have about 1000 emailboxes i have to convert over.

i got a file off the windows mailserver, mufassa,  that contains data 
that looked like this

domain.com                     user              
domain.net                       user1
domain.biz                       jandre

and so on

i need a result that shows:
vadduser user-9IKiO1iGCm/[email protected]
vadduser [email protected]

and so on

i managed to cat | cut out the user and domain.com but my problem is 
putting the 2 together to give me user-9IKiO1iGCm/[email protected],
i did a nice for loop that put them together but it did duplicates for 
some reason which i cant figure out

Here is my little script:

uname=`cat users.txt | cut -c46-70`;
dname=`cat users.txt | cut -c1-40`;



for i in $uname
        do for j in $dname; do
                echo "vadduser $i@$j"
        done
done


hope i made the understaing clear enough

thanks alot


-- 
Regards
 Jandre

		"Some people are alive only because
		 it is illegal to kill them."

_____________________________________________________
_______________________________________________
LinuxManagers mailing list - http://www.linuxmanagers.org
submissions: LinuxManagers-35TzE1X9F6582KRnZfj+bdi2O/[email protected]
subscribe/unsubscribe: http://www.linuxmanagers.org/mailman/listinfo/linuxmanagers