dotfiles/.local/bin/scripts/lowercase

6 lines
239 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-/' "$@"
find "$@" -exec sh -c 'mv -iv "{}" "$(echo "{}" | tr "A-Z " "a-z-" | sed "s|---|_|;s|\.-|.|")" 2>/dev/null' \;