changed bulkrename script to work work with filenames containing single quotation marks
This commit is contained in:
parent
929784da83
commit
10de418b6e
@ -313,7 +313,7 @@ Content:
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
if [ "$3" = "exec" ]; then
|
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
|
else
|
||||||
command ls | format -i "$1" -o "mv \"{0}\" \"$2\""
|
command ls | format -i "$1" -o "mv \"{0}\" \"$2\""
|
||||||
echo
|
echo
|
||||||
|
2
main.go
2
main.go
@ -140,7 +140,7 @@ func ReadLine(r *bufio.Reader) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func replaceVars(format string, vars ...string) string {
|
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 {
|
for _, replacement := range replacements {
|
||||||
rplStr := replacement[0]
|
rplStr := replacement[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user