Hi expert i am new in unix and i have been learning a lot through this site.
i found this script below on one of the post but i was really interested to see if someone maybe expert99 Can place some comments into the script to describe what it is doing from each line
Thanks
expert99:
This little script will echo the letters in a word one at a time with a one second pause between each letter. It is efficient because it is all in shell (except sleep, which can be removed). It works by executing the program with the word (STRING) you wish to display provided on the command line. As written the word must be all lower case with no spaces. You should be able to figure out how to handle mixed case easily. I hope this is what you were looking for.
expert99
#!/bin/sh
OLDIFS="$IFS"
STRING="$*"
while [ "$STRING" != "" ]
do
for C in a b c d e f g h i j k l m n o p q r s t u v w x y z
do
IFS="$C"
\s\e\t -- $STRING
IFS="$OLDIFS"
case "$STRING" in
"$C"?*)echo "$C\c"
sleep 1
case "$#" in
1)STRING="$1";;
2)STRING="$1$C$2";;
3)STRING="$1$C$2$C$3";;
4)STRING="$1$C$2$C$3$C$4";;
esac
;;
"$C")echo "$C"
break 2;;
esac
done
done
#! /bin/sh -x
to better understand the script operation