summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2023-06-30 03:24:31 -0700
committerHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2023-06-30 03:24:31 -0700
commita2e390f8e2348dded6650785c0bba60749903535 (patch)
treeae7865f589c1b2e33c6c51f0299ebfa2e504b20f
parentec1d430daf529802729aa1ab622ad1a2d7c53cd3 (diff)
surpressed bc error
-rwxr-xr-xtextd7
1 files changed, 4 insertions, 3 deletions
diff --git a/textd b/textd
index 57394a0..b4f4683 100755
--- a/textd
+++ b/textd
@@ -5,9 +5,10 @@
# in DIR
# assumes unicode utf-8 input
codes=$(iconv -f utf8 -t utf32be | xxd -u -p -c 4)
-#convert to decimal
-dec=$(echo -n "ibase=16;$codes" | bc)
+#convert to decimal, must replace ' ' with ';' first
+dec=$(echo -n "ibase=16;$codes" | bc 2>/dev/null)
+#converts space/newline delimited string to array
dec=($dec)
for decimal_code in "${dec[@]}"; do
- ./fontd "$decimal_code" "$1"
+ fontd "$decimal_code" "$1"
done