commit: 4119dc6f0323808c21095d4aa03ea4e722f36cad
parent 30037f199d038f2943b5db940ebee6f40a6445f3
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 23 Jul 2022 18:47:31 +0200
.common.sh: Make unicode-data functions start with ucd_
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/.common.sh b/.common.sh
@@ -148,14 +148,15 @@ pmounts() {
awk 'BEGIN { print "Mountpoint Type Device Options" } { print $2 " " $3 " " $1 " " $4 | "sort"}' /proc/mounts | column -t -s\
}
-grep_unicode() {
+ucd_grep() {
grep "$1" /usr/share/unicode-data/UnicodeData.txt | awk -F\; '{ system("unicode -t "$1); print FS "U+"$1 FS $2 }' | column -s\; -t
}
-wtf_unicode() {
- unicode -n "$1" | tr 'abcdef' 'ABCDEF' | while read char; do wat_unicode $char; done
+
+ucd_chars() {
+ unicode -n "$*" | tr 'abcdef' 'ABCDEF' | while read -r char; do ucd_code "$char"; done
}
-wat_unicode() {
- awk -F\; '{ if($1 == "'${1}'"){print "U+"$1 FS $2} }' /usr/share/unicode-data/UnicodeData.txt
+ucd_code() {
+ awk -F\; '{ if($1 == "'"${1}"'"){print "U+"$1 FS $2} }' /usr/share/unicode-data/UnicodeData.txt | grep . || echo "$1"
}
log_cmd() {