dotfiles/.local/bin/scripts/lowercase
2023-09-22 06:21:13 +02:00

6 lines
295 B
Bash
Executable file

#!/bin/sh
# Lowercase given files
#perl-rename 'y/A-Z /a-z-/' "$@"
#$(which perl-rename || echo rename) -iv 'y/A-Z /a-z-/' "$@"
sedrename "s| |-|;s|---|_|;s|\.-|.|;s|.*|\L\0|g" "$@"
# find "$@" -exec sh -c 'mv -iv "{}" "$(echo "{}" | tr "A-Z " "a-z-" | sed "s|---|_|;s|\.-|.|")" 2>/dev/null' \;