german_pronoun/german_pronoun.sh

14 lines
468 B
Bash
Raw Normal View History

2021-08-16 22:55:58 +00:00
#!/bin/bash
function de(){
fileName="$1.temp"
dudenURL="https://www.duden.de/suchen/dudenonline/$1"
wget "$dudenURL" --quiet -O "$fileName"
answer="$(grep "strong" "$fileName" | head -2 | tail -1 | sed -E "s|<(/)?strong>||g" | sed "s|^\s*||g")"
attributes="$(grep -A 3 vignette__snippet "$fileName" | head -4 | tail -1 | sed 's/.*$//g' | sed "s|^\s*||g")"
echo "$answer: $attributes"
rm "$fileName"
2021-08-16 22:55:58 +00:00
}
de $1