]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/functions
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 13 Apr 2018 04:29:38 +0000 (05:29 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 13 Apr 2018 04:29:38 +0000 (05:29 +0100)
etc/profile.d/functions

index 8ab6d518f83a9eb770d2ce25496a85fa66a655f7..c9f1f36be3d58be46055df8e10e0cee6dc71f628 100644 (file)
@@ -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}'
 }