diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-09-19 14:29:39 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-09-19 14:29:39 +0200 |
commit | 612634c364db841ef61ad0911b795a6e82afc3f1 (patch) | |
tree | 214b32b60b384c458860586acf8df191de8b1f0a /scripts | |
parent | aee833735d45875f1703baffa21514e99118aa03 (diff) | |
download | dotfiles-612634c364db841ef61ad0911b795a6e82afc3f1.tar.gz |
bulkrename mktemp
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bulkrename.sh | 6 |
1 files 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 |