aboutsummaryrefslogtreecommitdiff
path: root/local/bin/junk
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2024-11-21 10:04:34 +0100
committerCharles Cabergs <me@cacharle.xyz>2024-11-21 10:05:04 +0100
commit59297cbd2a6a5c78f131e3b1a8c60710198f5213 (patch)
tree55af1f12903d58bb11556a9f18f46428b5d055d8 /local/bin/junk
parent01f55c6e0a6005bbb051246cd08af49e09fd137c (diff)
downloaddotfiles-59297cbd2a6a5c78f131e3b1a8c60710198f5213.tar.gz
dotfiles-59297cbd2a6a5c78f131e3b1a8c60710198f5213.tar.bz2
dotfiles-59297cbd2a6a5c78f131e3b1a8c60710198f5213.zip
Fixing shellcheck errors
Diffstat (limited to 'local/bin/junk')
-rwxr-xr-xlocal/bin/junk8
1 files changed, 5 insertions, 3 deletions
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