if [ -s "$selection" ]; then
printf "Rename 'c'urrent / 's'election? "
read -r resp
+
+ if ! [ "$resp" = "c" ] && ! [ "$resp" = "s" ]; then
+ exit 1
+ fi
fi
if [ "$resp" = "s" ]; then
printf "%s: failed to rename %s to %s: %s\n" "$0" "$name" "$tmp" "$!" > /dev/stderr
exit_status=1
fi
-
+
for key in "${!items[@]}"; do
if [ "${items[$key]}" = "$name" ]; then
items[$key]="$tmp"
for key in "${!items[@]}"; do
items[$key]=$(printf "%s" "${items[$key]}" | sed "s|^$src\(\$\|\/\)|$name\1|")
done
-
+
printf "'%s' => '%s'\n" "$src" "$name"
else
printf "'%s' -> '%s'\n" "$src" "$name"
#define UTIL_FZY 16
#define UTIL_NTFY 17
#define UTIL_CBCP 18
-#define UTIL_NMV 19
+#define UTIL_BASH 19
+#define UTIL_NMV 20
/* Utilities to open files, run actions */
static char * const utils[] = {
"fzy",
".ntfy",
".cbcp",
+ "bash",
".nmv",
};
case SEL_RENAMEMUL:
endselection();
- if (!plugscript(utils[UTIL_NMV], newpath, path, F_CLI)
+ if (!(getutil(utils[UTIL_BASH])
+ && plugscript(utils[UTIL_NMV], newpath, path, F_CLI))
&& !batch_rename(path)) {
printwait(messages[MSG_FAILED], &presel);
goto nochange;