aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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