From f28d694879239d5d9c319185a278236d317a49b6 Mon Sep 17 00:00:00 2001 From: zachir Date: Sat, 30 Aug 2025 01:09:18 -0500 Subject: Make sh scrips POSIX compliant Using shellcheck, I went through all of them to make them standards compliant. I also tested as many as I could. --- dmenu_books | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'dmenu_books') diff --git a/dmenu_books b/dmenu_books index 3b6f1fe..a579476 100755 --- a/dmenu_books +++ b/dmenu_books @@ -5,15 +5,12 @@ printhelp () { } while getopts "hd:" o; do case "${o}" in - d) ARGS="$ARGS$OPTARG " ;; + d) ARG="$OPTARG" ;; *) printhelp ;; esac done -DMENU="dmenu" -DEFARGS="-l 15 -p" - -BOOK=`ls ~/Documents/shared | $DMENU $DEFARGS \"books\" $ARGS` +BOOK=$(find ~/Documents/shared | dmenu -l 15 -p \"books\" ${ARG:+"$ARG"}) [ -z "$BOOK" ] && exit 1 -zathura "~/Documents/shared/$BOOK" +zathura "$HOME/Documents/shared/$BOOK" -- cgit v1.2.3