#-- This script allows the user to practice his/her #-- aural comprehension of Spanish. It plays the sound #-- files of spanish words and phrases. #-- for file in [a-zA-Z]*.wav do ./WAV.EXE $file /Q echo 'Press to continue | "q" to quit | "h" for help' read line if [ "$line" = "q" ] then exit 0 fi if [ "$line" = "h" -o "$line" = "?" ] then echo ' SOME HELP INFORMATION ' echo 'This Spanish Practice script accepts the following commands: ' echo ' "q" + ends the script ' echo ' "e" + looks up the english equivalent of the spanish ' echo ' word which you just heard ' echo ' "h" or "?" + ' echo ' displays this help message ' fi if [ "$line" = "e" ] then echo 'English (looking up ...)' word=$(echo $file | sed 's/\..*$//g') # echo 'word=' $word #-- The line below looks up the word #-- on a spanish dictionary site and returns the #-- English equivalents by extracting the answer from #-- the html of the returned web-page. #-- This assumes that the file name of the sound file #-- (without the extension) is the written spanish version #-- of the word being said. wget -o temp.txt -O - -nd http://www.spanishdict.com/AS.cfm?e=$word | grep -A1 'ED.cfm' | sed -e '/ED\.cfm/d' -e 's/<\/a>//g' fi echo "You heard (Spanish): " $file | sed 's/\..*$//g' echo '--------------------------------------' done # # wget -o temp.txt -O - -nd http://www.spanishdict.com/AS.cfm?e=abuelo | grep -A1 'ED.cfm' | sed -e '/ED\.cfm/d' -e 's/<\/a>//g' #