#! /bin/sh #### dict.leo.org version 2.0 beta 1 set -euf cache_dir=/tmp/dict.leo.org/ file="$cache_dir$*" url="http://dict.leo.org/?$*" # TODO check sanity of filename if test -d "$cache_dir" ; then test -e "$file" || { curl --silent "$url" | tee "$file" ; } else curl --silent "$url" fi | sed 's/>\( *.\)/>\n\1/g' | sed -n ' s/[[:space:]]/ /g //,/<\/td>/b //,/^<\/td>/b //,/^ <\/table>/b /