aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-01-25 20:45:00 +0100
committerVG <vg@devys.org>2016-01-25 20:45:00 +0100
commitd114e9d54d63daa072cf0ea10e6a058592808a38 (patch)
tree7c6541ecddd8a4f5a4e232c125aff504216041aa
parentbe3b62e47d6e89b5f5f17bba7d05a508d0f90bfa (diff)
downloadbulkrename-d114e9d54d63daa072cf0ea10e6a058592808a38.tar.gz
bulkrename-d114e9d54d63daa072cf0ea10e6a058592808a38.tar.bz2
bulkrename-d114e9d54d63daa072cf0ea10e6a058592808a38.zip
better user direction
-rwxr-xr-xbulkrename3
1 files changed, 3 insertions, 0 deletions
diff --git a/bulkrename b/bulkrename
index bb19f21..e0a23d8 100755
--- a/bulkrename
+++ b/bulkrename
@@ -11,10 +11,13 @@ fi
EDITOR="${EDITOR:-vi}"
namebase="$(mktemp -d)/blkrn"
+echo '# Modify filenames without removing any line, quitting aborts' \
+ > "${namebase}.2"
tee -- "${namebase}.1" >> "${namebase}.2"
exec </dev/tty >/dev/tty || { echo 'Interactive terminal needed' >&2 ; exit 1; }
"$EDITOR" "${namebase}.2"
+sed -i -- '1d' "${namebase}.2"
if [ $(wc -l < "${namebase}.1") -ne $(wc -l < "${namebase}.2") ] ; then
rm -r "$(dirname "${namebase}")"