aboutsummaryrefslogtreecommitdiff
path: root/local/bin/junk
diff options
context:
space:
mode:
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