commit 83c3b1a76cd2a80b90b3929425f06a732cc23d70
parent 92ecf0e9716b0ab03c1045068d8d15eb9802b245
Author: Jared Tobin <jared@jtobin.io>
Date: Fri, 29 Jan 2021 16:06:21 +0400
Use herestrings.
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/conj b/conj
@@ -304,8 +304,6 @@ amārent,āctivum,coniūnctīvus,imperfectum,3pp,would that they loved
EOF
)
-LOOP=true
-
prompt() {
read -p '' -n 1 -r <&1
if [[ $REPLY =~ ^[Qq]$ ]]; then
@@ -313,13 +311,15 @@ prompt() {
fi
}
+LOOP=true
+
while $LOOP; do
clear
- lent=$(echo "$DATA" | wc -l | cut -f 1 -d' ')
+ lent=$(wc -l <<< "$DATA" | cut -f 1 -d' ')
line=$(shuf -i 1-"$lent" -n 1)
- cont=$(echo "$DATA" | sed -n "$line"p)
+ cont=$(sed -n "$line"p <<< "$DATA")
echo "$cont" | cut -f 1 -d,