bash-toys/toys/typewritter.sh

20 lines
337 B
Bash
Executable File

#!/bin/bash
## Apply a silly typing effect to whatever the input is.
if [ $# -eq 0 ]
then
echo "No arguments supplied."
echo "What do you want to type?"
read text
else
text="$*"
fi
for (( i=0; i<${#text}; i++ )); do
echo -ne "${text:$i:1}"
sleep 0.1
done
echo ""; # add newline at the end
exit 1;