changed bulkrename script to work work with filenames containing single quotation marks

This commit is contained in:
milarin 2023-06-14 14:46:57 +02:00
parent 929784da83
commit 10de418b6e
2 changed files with 2 additions and 2 deletions

View File

@ -313,7 +313,7 @@ Content:
#!/usr/bin/env sh
if [ "$3" = "exec" ]; then
command ls | format -i "$1" -o "mv \"{0}\" \"$2\"" | xargs -0 -P 4 sh -c
command ls | format -0 -i "$1" -o "mv \"{0}\" \"$2\"" | xargs -0 -P 4 -I {} sh -c "{}"
else
command ls | format -i "$1" -o "mv \"{0}\" \"$2\""
echo

View File

@ -140,7 +140,7 @@ func ReadLine(r *bufio.Reader) (string, error) {
}
func replaceVars(format string, vars ...string) string {
replacements := replacePattern.FindAllStringSubmatch(format, -1)
replacements := replacePattern.FindAllStringSubmatch(format, -1) // TODO arguments do not change in outer loop (can be moved to main method)
for _, replacement := range replacements {
rplStr := replacement[0]