summaryrefslogtreecommitdiff
path: root/.local/bin/mvtr
blob: b48dcb20dd11b3d265f3f843c2d9fb0928e030e5 (plain)
1
2
3
4
5
6
7
#!/bin/sh

# can use ls pipe to sed pipe to bash, similar to eval? see comment at link:
# link also show perl-rename approach
# 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
find "$@" -depth -exec sh -c 'mv -nvT -- "$1" "$(echo "$1" | tr "[:upper:] " "[:lower:]_")"' shell '{}' \;
pan> c) tz_from="Asia/Shanghai";; f) tz_from="$(tzselect)";; F) tz_from="$OPTARG";; # one extra ',' at the end will not let `for tz in ...` loop one extra time? t) for i in $(seq "$OPTARG"); do tz_to="$(tzselect),$tz_to" done;; T) tz_to="$OPTARG,$tz_to";; \?) exit 1;; esac done shift $((OPTIND-1))