diff options
| author | filip <“filip.rabiega@gmail.com”> | 2026-01-21 10:36:12 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2026-01-21 10:36:12 +0100 |
| commit | 88f0243428c4cf39029c8ffc5a7e1634951158a0 (patch) | |
| tree | f8b05b9f056dd72b7955f90560c453b4c317bd92 /dictloop | |
| parent | 83954961af8b6337da100e038561f2fd975ac1fe (diff) | |
| download | chadscripts-88f0243428c4cf39029c8ffc5a7e1634951158a0.tar.gz chadscripts-88f0243428c4cf39029c8ffc5a7e1634951158a0.tar.bz2 chadscripts-88f0243428c4cf39029c8ffc5a7e1634951158a0.zip | |
add comments to some scripts
Diffstat (limited to 'dictloop')
| -rwxr-xr-x | dictloop | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -1,16 +1,21 @@ -#!/usr/bin/zsh +#!/bin/sh +# Script for checking multiple definitions one after another -setopt aliases -source "$ZDOTDIR/aliasrc" +# Load aliases if available +if [ -n "$ZDOTDIR" ] && [ -f "$ZDOTDIR/aliasrc" ]; then + . "$ZDOTDIR/aliasrc" +fi -[ "$#" -ne 1 ] && { +# Argument check +if [ "$#" -ne 1 ]; then echo "Usage: dictloop <dict>" >&2 exit 1 -} -dict="$1" # a command-line dictionary +fi -while true; do - echo "Enter a word: " +dict=$1 + +while :; do + printf "Enter a word: " read -r word if [ -z "$word" ] || [ "$word" = "exit" ]; then @@ -20,5 +25,3 @@ while true; do "$dict" "$word" done - -exit 0 |
