diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2023-02-11 15:15:24 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2023-02-11 15:15:24 +0800 |
| commit | f42815f4640d96ef24b21a776b3fd091011199bf (patch) | |
| tree | 0937d84b043ae9846b09ae53b3cab233a8d00210 | |
| parent | ea62498eb672f3debe7907436bfe84b300b1fc28 (diff) | |
Update
| -rwxr-xr-x | tools/misc/flash.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/misc/flash.sh b/tools/misc/flash.sh index 5bd48bc..93ce8fd 100755 --- a/tools/misc/flash.sh +++ b/tools/misc/flash.sh | |||
| @@ -1,11 +1,17 @@ | |||
| 1 | #! /bin/bash | 1 | #! /bin/bash |
| 2 | 2 | ||
| 3 | while true; do | 3 | while true; do |
| 4 | CARD="$(cat ~/log/flashcards.md | shuf | head -1)" | 4 | CARDS="$(cat ~/log/flashcards.md | shuf | head -5)" |
| 5 | CARD="$(<<<"$CARDS" sed -n 3p)" | ||
| 5 | 6 | ||
| 6 | # Print the Question | 7 | # Print the Question |
| 7 | <<<"$CARD" tr -s '\t' | cut -f1 | 8 | <<<"$CARD" tr -s '\t' | cut -f1 |
| 8 | echo | 9 | echo |
| 10 | tput bold; tput setaf 1 | ||
| 11 | <<<"$CARDS" tr -s '\t' | cut -f2 | tr '\n' '\t' | ||
| 12 | tput sgr0 | ||
| 13 | echo | ||
| 14 | echo | ||
| 9 | echo ---- | 15 | echo ---- |
| 10 | echo | 16 | echo |
| 11 | 17 | ||