#-- FILE: #-- lookupList-sp-en.txt #-- DESCRIPTION: looks up the english meanings of a #-- list of spanish words (based on file names) #-- AUTHOR: #-- mj bishop #-- DATES: june 2002, sept 02 #-- LOCATION: #-- http://www.geocities.com/matth3wbishop/eg/unix-shell/ #-- TESTING: #-- This script has been tested on the Cygwin #-- unix emulator running on WinMe. #-- urls of online spanish dictionaries. sUrlHarperCollins="http://www.wordreference.com/es/en/translation.asp?spen" sUrlSpanishDict="http://www.spanishdict.com/AS.cfm?e" #-- Check for valid parameters if [ "$1" = "" ] then echo " usage: ./lookupList-sp-en.txt WordListFile [SavePath] Description: This script looks up the English meanings of a List of Spanish 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 Spanish Words. SavePath This is the path (relative or not) in which to save the definition files " exit 1 else sWordListFile="$1" fi if [ "$2" = "" ] then sSavePath="." else sSavePath="$2" fi #-- User progress message echo " TRANSLATING WORDS " for word in $(cat $sWordListFile | sed '/^ *#/d') do echo $word lynx --dump $sUrlHarperCollins=$word \ | sed -n '/\[3\]/,/\[4\]/p' \ | sed '1d' > $sSavePath/$word.tran.txt done