From 612634c364db841ef61ad0911b795a6e82afc3f1 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sat, 19 Sep 2020 14:29:39 +0200 Subject: bulkrename mktemp --- scripts/bulkrename.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/bulkrename.sh b/scripts/bulkrename.sh index 9df17d2..186326a 100755 --- a/scripts/bulkrename.sh +++ b/scripts/bulkrename.sh @@ -5,9 +5,7 @@ EDITOR=${EDITOR=:vi} -while [ -z "$TMPFILE" -o -e "$TMPFILE" ]; do - TMPFILE="/tmp/bulkrename.$RANDOM" -done +TMPFILE="$(mktemp)" touch "$TMPFILE" FILES=( ) @@ -31,7 +29,7 @@ while read line; do if [ -e "${FILES[$i]}" -a ! -e "$line" ]; then mv "${FILES[$i]}" "$line" else - echo Error. does target already exist? + echo "Skipping ${FILES[$i]} -> $line . Target already exists." fi fi -- cgit v1.2.3