From 88f0243428c4cf39029c8ffc5a7e1634951158a0 Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Wed, 21 Jan 2026 10:36:12 +0100 Subject: add comments to some scripts --- dictloop | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'dictloop') diff --git a/dictloop b/dictloop index 738b3c0..1a239ea 100755 --- a/dictloop +++ b/dictloop @@ -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 " >&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 -- cgit v1.2.3