Shell script to create LDIF

| 0 Comments | 0 TrackBacks
!/bin/bash touch new-import.ldif for CUST in `cat address-com.txt` do REP_FIRSTNAME="`echo $CUST | cut -d, -f1`" REP_LASTNAME="`echo $CUST | cut -d, -f2`" REP_EMAIL="`echo $CUST | cut -d, -f3`" REP_FULLNAME="$REP_FIRSTNAME$REP_LASTNAME" cat importthis-address-template.ldif | sed -e \ "s/FULLNAME/$REP_FULLNAME/" | \ sed -e "s/FIRSTNAME/$REP_FIRSTNAME/" \ | sed -e "s/LASTNAME/$REP_LASTNAME/" | \ sed -e "s/EMAIL/$REP_EMAIL/" >> new-import.ldif done 

No TrackBacks

TrackBack URL: http://baldwinsung.com/cgi-bin/mt-tb.cgi/12

Leave a comment

Recent Entries

Test
Test…
I just finished installing Movable Type 4!
Welcome to my new blog powered by Movable Type. This is the first post on my blog and was created…
New design launched using Movable Type
Our web site is sporting a new look and feel thanks to Movable Type and the Professional Template Set.…