#-- FILE: #-- lookupList-fr-en.txt #-- DESCRIPTION: looks up the english meanings of a #-- list of french words (based on file names) #-- AUTHOR: #-- mj bishop #-- DATES: june 2002 #-- TESTING: #-- This script has been tested on the Cygwin #-- unix emulator running on WinMe. #-- urls of online french dictionaries. sUrlHarperCollins="http://www.wordreference.com/fr/en/translation.asp?fren" #-- Check for valid parameters if [ "$1" = "" ] then echo " usage: ./lookupList-sp-en.txt WordListFile Description: This script looks up the English meanings of a List of french words on the site http://www.wordreference.com/ and saves each result into its own file Parameters: WordListFile This is the file which contains the list of french Words. " exit 1 else sWordListFile="$1" fi #-- User progress message echo " TRANSLATING WORDS " for word in $(cat $sWordListFile | sed '/^ *#/d') do echo $word lynx --dump $sUrlHarperCollins=$word \ | sed '/ *\[[0-9]*\]/d' \ | sed -n '/ *See Also/,/ *-The Collins/p' \ | sed -e '1d' -e '$d' > $word.tran.txt head -4 $word.tran.txt | tail -2 done