summaryrefslogtreecommitdiff
path: root/dictloop
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2025-10-10 19:10:02 +0200
committerfilip <“filip.rabiega@gmail.com”>2025-10-10 19:10:02 +0200
commit807de46d3a3cbef9a3c3c104f6db87b142e6eed5 (patch)
tree61a1a9bc26daad623ce6c04bb66ae39133ef0261 /dictloop
parent08204fc9b9f63015a1dc083b471c6839818eeb59 (diff)
downloadchadscripts-807de46d3a3cbef9a3c3c104f6db87b142e6eed5.tar.gz
chadscripts-807de46d3a3cbef9a3c3c104f6db87b142e6eed5.tar.bz2
chadscripts-807de46d3a3cbef9a3c3c104f6db87b142e6eed5.zip
used shfmt
Diffstat (limited to 'dictloop')
-rwxr-xr-xdictloop19
1 files changed, 11 insertions, 8 deletions
diff --git a/dictloop b/dictloop
index 6e9735b..a47e98c 100755
--- a/dictloop
+++ b/dictloop
@@ -3,19 +3,22 @@
setopt aliases
source "$ZDOTDIR/aliasrc"
-[ "$#" -ne 1 ] && { echo "Usage: dictloop <dict>" >&2; exit 1; }
+[ "$#" -ne 1 ] && {
+ echo "Usage: dictloop <dict>" >&2
+ exit 1
+}
dict="$1" # a command-line dictionary
while true; do
- echo "Enter a word: "
- read -r word
+ echo "Enter a word: "
+ read -r word
- if [ -z "$word" ] || [ "$word" = "exit" ]; then
- echo "Exiting..."
- exit 0
- fi
+ if [ -z "$word" ] || [ "$word" = "exit" ]; then
+ echo "Exiting..."
+ exit 0
+ fi
- "$dict" "$word"
+ "$dict" "$word"
done
exit 0