summaryrefslogtreecommitdiff
path: root/dictloop
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2025-09-23 13:55:43 +0200
committerfilip <“filip.rabiega@gmail.com”>2025-09-23 13:55:43 +0200
commit8b23667b4e7435e96a60d99c3f5e5e9583237b18 (patch)
tree1f5f49aecf38948f03de978aac0db49c0b9e7143 /dictloop
parente4ea00cfc9fc7340c62dd920b4754787c4499de6 (diff)
downloadchadscripts-8b23667b4e7435e96a60d99c3f5e5e9583237b18.tar.gz
chadscripts-8b23667b4e7435e96a60d99c3f5e5e9583237b18.tar.bz2
chadscripts-8b23667b4e7435e96a60d99c3f5e5e9583237b18.zip
new stuff
Diffstat (limited to 'dictloop')
-rwxr-xr-xdictloop21
1 files changed, 21 insertions, 0 deletions
diff --git a/dictloop b/dictloop
new file mode 100755
index 0000000..6e9735b
--- /dev/null
+++ b/dictloop
@@ -0,0 +1,21 @@
+#!/usr/bin/zsh
+
+setopt aliases
+source "$ZDOTDIR/aliasrc"
+
+[ "$#" -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
+
+ if [ -z "$word" ] || [ "$word" = "exit" ]; then
+ echo "Exiting..."
+ exit 0
+ fi
+
+ "$dict" "$word"
+done
+
+exit 0