mvnForum Homepage


Posted by jazzuban at Oct 10, 2007 11:53:49 PM
Re: How to use diatheke?
I use diatheke to show results in a console. Paste the following code into a file, put that file somewhere in your path and make it executable.


#!/bin/bash
#Display Bible verses using diatheke
#Feel free to modify and improve
#Public Domain License

#Set this to your favorite resource, e.g. BOOK=KJV
BOOK=WEB

clear
echo "#################################################"
echo " Diatheke: display Bible verses"
echo " enter reference or write "quit" to exit"
echo "#################################################"


#This will make the script parse any references given
# as command line arguments

if [ $# -ge 1 ]; then
diatheke -b $BOOK -k $*
fi


## Main function - keep reading references until "quit" is given
# you can also exit by pressing CTRL + C

while [ 1 ]
do
read -p "verse> " INPUT
if [ "$INPUT" != "quit" ]
then
diatheke -b $BOOK -k $INPUT
echo _______________________________________
else
exit
fi

done

exit 0