aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-01-24 18:27:20 +0100
committerVG <vg@devys.org>2016-01-24 18:27:20 +0100
commit8c3ce92e29095539e5581535da5201782306eb06 (patch)
tree54d47df6b85fbccd5b132f4cf62f061ff78c0fca
parente4af2866cdf0a99b3cc5a1b4552329d3c59d15e2 (diff)
downloadbulkrename-8c3ce92e29095539e5581535da5201782306eb06.tar.gz
bulkrename-8c3ce92e29095539e5581535da5201782306eb06.tar.bz2
bulkrename-8c3ce92e29095539e5581535da5201782306eb06.zip
add error message for controlling/interactive terminal for clarity
-rwxr-xr-xbulkrename4
1 files changed, 2 insertions, 2 deletions
diff --git a/bulkrename b/bulkrename
index 5a5c9d1..997f3a3 100755
--- a/bulkrename
+++ b/bulkrename
@@ -9,11 +9,11 @@ if [ $# -ne 0 ] ; then
exit
fi
-[ -x "$(which "$EDITOR" 2>/dev/null)" ] || EDITOR='vi'
+EDITOR="${EDITOR:-vi}"
file=/tmp/blkrn-$$
cat > ${file}.1
-exec </dev/tty >/dev/tty
+exec </dev/tty >/dev/tty || { echo 'Interactive terminal needed' >&2; exit; }
cp ${file}.1 ${file}.2
"$EDITOR" ${file}.2