diff options
author | Dylan Araps <dylan.araps@gmail.com> | 2019-01-26 23:47:00 +0200 |
---|---|---|
committer | Dylan Araps <dylan.araps@gmail.com> | 2019-01-26 23:47:00 +0200 |
commit | 1c7ed3c1abcb2eb3211bcb97385fe703b5321654 (patch) | |
tree | 49540e01f56bf08a54a2452986e7adcd1a22a18a | |
parent | c3308e1f15308ab8b29ced8f33c622958115487c (diff) |
general: Escape space characters to fix word splitting.
-rwxr-xr-x | fff | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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" |