dotfiles/.local/bin/scripts/lowercase

7 lines
295 B
Plaintext
Raw Normal View History

2021-10-31 19:27:18 +00:00
#!/bin/sh
# Lowercase given files
2023-04-21 07:26:34 +00:00
#perl-rename 'y/A-Z /a-z-/' "$@"
#$(which perl-rename || echo rename) -iv 'y/A-Z /a-z-/' "$@"
2023-09-22 04:21:13 +00:00
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' \;