!/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
Shell script to create LDIF
No TrackBacks
TrackBack URL: http://baldwinsung.com/cgi-bin/mt-tb.cgi/12
Leave a comment