UNIX korn shell - how to use printf or echo to produce blinking text

Hopefully a simple question - is there some way to produce blinking text using echo or printf from within a korn shell script?

For example, printf "\rSome Text Here" will cause the output to start at the beginning of the current line. Is there a similar control character that can be used to cause text to blink?
Who is Participating?
woolmilkporcConnect With a Mentor Commented:
..... an easier way -
bl=$(tput blink)
nbl=$(tput sgr0)
echo "${bl}foo${nbl}"
Todd MummertConnect With a Mentor Commented:

yes... but many terminal emulators don't fully support it any more

you can use escape sequences like:

echo "^[[5;31;40m"

(the first  two characters above is a single escape   (generated with ctrl-v esc)

alternately, you could try  the commands

tput blink;  echo foo; tput sgr0

http://tldp.org/LDP/abs/html/colorizing.html  for more info

Kerem ERSOYPresidentCommented:
While \r will cause the cursor to locate at the beginning of current line. To cause the blinking you'd use VT100 escape sequences thoug such as:

printf "\r\e[0;5mblahh"

Will cause the line to blink.

Kerem ERSOYPresidentCommented:
of course you need

printf "\e[0m"  

to stop blinking :)
Kerem ERSOYPresidentCommented:
Why not

echo "$(tput blink)SSSSSSSSSS$(tput sgr0) aaaaa"

Then ;-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.