From 59297cbd2a6a5c78f131e3b1a8c60710198f5213 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 21 Nov 2024 10:04:34 +0100 Subject: Fixing shellcheck errors --- local/bin/junk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'local/bin/junk') diff --git a/local/bin/junk b/local/bin/junk index faf9b32..9758f68 100755 --- a/local/bin/junk +++ b/local/bin/junk @@ -11,9 +11,11 @@ do if [ -e "$dest" ] then echo "$dest already exists, generating a prefix" - identifier="$(seq 100 | xargs -I N sh -c "echo N; test -e '$dest__N' || exit 255" 2> /dev/null | tail -n1)" + identifier="$(seq 100 | xargs -I N sh -c "echo N; test -e '""$dest""__N' || exit 255" 2> /dev/null | tail -n1)" dest="$dest"__"$identifier" fi - mv "$arg" "$dest" && - echo "$arg moved to $dest" || true + if mv "$arg" "$dest" + then + echo "$arg moved to $dest" + fi done -- cgit