vfdboard/scripts/say.sh

26 lines
410 B
Bash
Raw Normal View History

2018-01-13 12:37:08 +01:00
#!/bin/bash
source common.sh
echo "t" > $hcs
echo -n "s" > $hcs
text=`echo "$1" | tr '\n' '\r' | sed "s/\r/ -- /g"`
text="-- $text "
echo "$text"
for (( i=0; i<${#text}; i++ )); do
c="${text:$i:1}"
chr=`LC_CTYPE=C printf '%d' "'$c"`
if [ "$chr" -gt "31" ]; then
echo -n "$c" > $hcs
echo -n "$c"
sleep 0.1
else
echo -n "#"
echo -n "$c" > $hcs
fi;
done
echo "$c" > $hcs
echo "$c"