#!/bin/bash # interface for address book look-up # last change: 3 August 2003 # Martin Kluge (Martin_Kluge@gmx.de) # Fred Marton (Fred.marton@uni-bayreuth.de) # get the location of the address-book-files ADDR_BOOK_DIR=`sylpheed --config-dir` # function to actually search the adressbook-content look_into_addressbooks() { TMP=`mktemp /tmp/.awXXXXXX` cd ~/${ADDR_BOOK_DIR} # read out all adressbooks and concatenate them for i in `ls addrbook-0*.xml` ; do sylpheed2txt.pl $ADDR_BOOK_DIR ${i} ${TMP} done # look for information for A in $* do echo egrep -i ${A} ${TMP} done echo rm ${TMP} } # Main echo -n "Sylpheed-Address-Search: Give a searchterm (stop with x): " read INPUT while [ ${INPUT} != 'x' ] && [ ${INPUT} != 'X' ] ; do look_into_addressbooks ${INPUT} echo echo -n "Sylpheed-Address-Search: Give a searchterm (stop with x): " read INPUT done