From f42815f4640d96ef24b21a776b3fd091011199bf Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sat, 11 Feb 2023 15:15:24 +0800 Subject: Update --- tools/misc/flash.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/misc/flash.sh') 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 @@ #! /bin/bash while true; do - CARD="$(cat ~/log/flashcards.md | shuf | head -1)" + CARDS="$(cat ~/log/flashcards.md | shuf | head -5)" + CARD="$(<<<"$CARDS" sed -n 3p)" # Print the Question <<<"$CARD" tr -s '\t' | cut -f1 echo + tput bold; tput setaf 1 + <<<"$CARDS" tr -s '\t' | cut -f2 | tr '\n' '\t' + tput sgr0 + echo + echo echo ---- echo -- cgit v1.2.3-70-g09d2