Reorganise gists folder

This commit is contained in:
TKE
2022-05-13 12:49:21 +02:00
parent ecd3c7fe2f
commit acd8d616dc
98 changed files with 63 additions and 20 deletions

18
codegrab/lpic.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
index=0
cat $@ | hxselect .qtext -s "@TKE@" | tr -d "\n" | tr -s " " | sed -e 's/@TKE@/\n/g' | while read block; do
(( index++ ))
echo "Frage $index"
echo "=================="
frage=$(echo $block | hxnormalize -e | sed -ne '/div class=qtext/,/div class=answer/p' | html2text)
echo $frage
echo "Antworten:"
answ=$(echo $block | hxnormalize -e | hxselect .answers )
echo $answ
echo "Erklärung:"
expl=$(echo $block | hxnormalize -e | hxselect .explanation )
echo $expl
echo "=================="
echo "=================="
done