vfdboard/scripts/say.sh

26 lines
410 B
Bash
Executable File

#!/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"