diff options
author | Marianne Chevrot <blackmoor@devys.org> | 2018-08-12 21:41:39 +0200 |
---|---|---|
committer | Cédric Picard <cpicard@purrfect.fr> | 2018-08-18 09:08:03 +0200 |
commit | e19fe8b4f41506e334c61f371be40b1f7ea65995 (patch) | |
tree | 139846f8157cf6f55f0328d14b1f8ed592cb66e3 | |
parent | b217b23ada2597292934a1f22001719c014b0ebb (diff) | |
download | bulkrename-e19fe8b4f41506e334c61f371be40b1f7ea65995.tar.gz bulkrename-e19fe8b4f41506e334c61f371be40b1f7ea65995.tar.bz2 bulkrename-e19fe8b4f41506e334c61f371be40b1f7ea65995.zip |
Fix renaming to an already existing name
-rwxr-xr-x | bulkrename | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -28,9 +28,9 @@ fi sed -i -- 's/\([\\"$`]\)/\\\1/g;' "${namebase}.1" "${namebase}.2" (echo '# Please review/modify this script or empty it to do nothing' \ - ; paste -d "\n" -- "${namebase}.1" "${namebase}.2" \ - | uniq -c \ - | sed -n 's/^ *1 \(.*\)$/"\1"/p' \ + ; comm -3 --output-delimiter="" "${namebase}.1" "${namebase}.2" \ + | tr -d '\0' \ + | sed 's/^.*$/"&"/' \ | xargs -d"\n" -L2 echo 'mv -i --') \ > "${namebase}.sh" |