From d2127e7e36f36421184a422e56665ed9ca8fc9de Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 13 Apr 2018 05:29:38 +0100 Subject: [PATCH] etc/profile.d/functions --- etc/profile.d/functions | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 8ab6d518..c9f1f36b 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -770,6 +770,17 @@ END { ' $@ } +# NB 13.04.18: TODO +# NB 13.04.18 file_to_utf8() { +# NB 13.04.18 local usage="file_to_utf8 [FILES|DIRS]" +# NB 13.04.18 find $@ -type f | while read file; do +# NB 13.04.18 enc=$(file --mime-encoding "$file" | sed 's/^.*\? \([^ ]\+\)$/\1/' | awk '{print tolower($0)}') +# NB 13.04.18 #file --mime-encoding "$file" +# NB 13.04.18 printf '%s : ' "$file" +# NB 13.04.18 iconv -f "$enc" -t utf-8 "$file" | wc -c +# NB 13.04.18 done +# NB 13.04.18 } + file_user() { ls -dl "$1" | awk '{print $3}' } -- 2.47.3