From 8f4fda1a1f9036d4ac89de3e049f61b5ede7fbf0 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sun, 30 Oct 2022 10:29:54 +0100 Subject: [PATCH] config/shell/functions/lowercase: refine queries --- .config/shell/functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/shell/functions b/.config/shell/functions index 7c5b55b..b9e9874 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -462,10 +462,10 @@ else alias f1='find -mindepth 1 -maxdepth 1' fi -lowercase_transliterate="y/A-Z /a-z-/" -which perl-rename >/dev/null && - alias lowercase="perl-rename -iv '$lowercase_transliterate'" || - alias lowercase="rename -iv '$lowercase_transliterate'" +lowercase() { + #$(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' \; +} # TODO replace cp by rsync, automatically use compression for remote transfers # rsync directory properly - suffix both dirs with / to act on contents