summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-08-27 18:52:40 -0700
committerxyz <gky44px1999@gmail.com>2021-08-27 18:52:40 -0700
commit617e343d5cb0a6f9f92000a42c98fddb6ab0424b (patch)
treefa1bc3b84c1ab76ddefdebadda2ca4cb8a69690f
parent7a9e4a35f88ba955332dadeef75668105003aaac (diff)
use inside sh -c, use sh as name for /bin/bash
-rwxr-xr-x.local/bin/mvtr2
1 files changed, 1 insertions, 1 deletions
diff --git a/.local/bin/mvtr b/.local/bin/mvtr
index 574ccd9b..7744da51 100755
--- a/.local/bin/mvtr
+++ b/.local/bin/mvtr
@@ -5,4 +5,4 @@
# https://linuxconfig.org/rename-all-files-from-uppercase-to-lowercase-characters
# if only change ' ' to '_' `rename` might be sufficient, for upper to lower case might need perl-rename if want concise
# shellcheck suggest use $1 for sh -c for better error messaging? see SC2156
-find "$@" -depth -execdir sh -c 'mv -nvT -- "$0" "$(echo "$0" | tr "[:upper:] " "[:lower:]_")"' '{}' \;
+find "$@" -depth -execdir sh -c 'mv -nvT -- "$1" "$(echo "$1" | tr "[:upper:] " "[:lower:]_")"' sh '{}' \;