From 11f3ccd8c545c889821adcc0b1a7fc06fb833503 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 22 Nov 2023 19:41:48 +0100 Subject: uni: Big performance improvements --- .local/bin/uni | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to '.local/bin') diff --git a/.local/bin/uni b/.local/bin/uni index d0dbc36..778d2eb 100755 --- a/.local/bin/uni +++ b/.local/bin/uni @@ -14,15 +14,16 @@ setup() /^[^;]*;"$DATA" } readonly DATA="${XDG_DATA_HOME:-$HOME/.local/share}/unicode-data" [ -f "$DATA" ] || setup -opt="$(cut -d';' -f2 "$DATA" | osel)" -rune="$(awk -vopt="$opt" -F';' '$2 == opt { print $1 }' "$DATA" | xargs printf)" +idx="$(cut -d';' -f2 "$DATA" | osel -i)" +code="$(head -n "$idx" "$DATA" | tail -n1 | cut -d';' -f1)" +rune="$(printf $code)" if [ -t 2 ] then -- cgit v1.2.3