diff options
author | VG <vg@devys.org> | 2016-01-25 20:45:00 +0100 |
---|---|---|
committer | VG <vg@devys.org> | 2016-01-25 20:45:00 +0100 |
commit | d114e9d54d63daa072cf0ea10e6a058592808a38 (patch) | |
tree | 7c6541ecddd8a4f5a4e232c125aff504216041aa | |
parent | be3b62e47d6e89b5f5f17bba7d05a508d0f90bfa (diff) | |
download | bulkrename-d114e9d54d63daa072cf0ea10e6a058592808a38.tar.gz bulkrename-d114e9d54d63daa072cf0ea10e6a058592808a38.tar.bz2 bulkrename-d114e9d54d63daa072cf0ea10e6a058592808a38.zip |
better user direction
-rwxr-xr-x | bulkrename | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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}")" |