summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-01-26 23:47:00 +0200
committerDylan Araps <dylan.araps@gmail.com>2019-01-26 23:47:00 +0200
commit1c7ed3c1abcb2eb3211bcb97385fe703b5321654 (patch)
tree49540e01f56bf08a54a2452986e7adcd1a22a18a
parentc3308e1f15308ab8b29ced8f33c622958115487c (diff)
general: Escape space characters to fix word splitting.
-rwxr-xr-xfff5
1 files changed, 3 insertions, 2 deletions
diff --git a/fff b/fff
index c436e37..6e861b5 100755
--- a/fff
+++ b/fff
@@ -395,8 +395,9 @@ bulk_rename() {
# Construct the rename commands.
for ((i=0;i<${#marked_files[@]};i++)); {
[[ ${marked_files[i]} != "${changed_files[i]}" ]] && {
- printf 'mv -i -- "%s" "%s"\n' \
- "${marked_files[i]}" "${PWD}/${changed_files[i]}"
+ printf 'mv -i -- %s %s\n' \
+ "${marked_files[i]// /\\ }" \
+ "${PWD}/${changed_files[i]// /\\ }"
local renamed=1
}
} >> "$rename_file"