diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2026-03-01 18:31:59 +0200 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2026-03-01 18:31:59 +0200 |
| commit | fe46aade877ab4569a72d580477aa32a55da1bc9 (patch) | |
| tree | dc4e4a1594ca2230402e226fb9880536fb360d46 | |
| parent | 6eb8afe388579511a248a4430271e502c528f071 (diff) | |
bulk_rename: skip unmodified
| -rwxr-xr-x | script/bulk-rename | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/script/bulk-rename b/script/bulk-rename index 3bd6c85..7446cf4 100755 --- a/script/bulk-rename +++ b/script/bulk-rename @@ -32,7 +32,10 @@ e() { rm -f "$f" || :; exit "$1"; } exec 3<"$f" && for _ do IFS= read -r l <&3 - set -- "$@" "mv -f -- '$1' '${l:?line mismatch in rename file}'" + case ${l:?line mismatch in rename file} in + "$1") set -- "$@" "# not modified: '$1'" ;; + *) set -- "$@" "mv -f -- '$1' '$l'" + esac shift done && { read -r l <&3 && { |