How to make a text blink in shell script

user2519862 picture user2519862 · Jul 3, 2013 · Viewed 62.9k times · Source

I have this piece of code below:

echo " \033[33mTitle of the Program\033[0m"

which changes the colour to yellow.

How can I make the text "Title of the Program" blink?

Answer

iconoclast picture iconoclast · Jul 29, 2014

Try adding -e if it's not working without it

You may need to add the -e option to echo (at least that's required on all or most systems I use). The following will tell your system to blink the text:

echo  -e "\033[5mTitle of the Program\033[0m"

You can have blinking and color

And you don't have to choose either yellow or blinking. You can have your cake and eat it too:

echo  -e "\033[33;5mTitle of the Program\033[0m"

Some systems ignore blink codes

Your system may ignore the blink code—this appears to be quite common. If you want to make the text prominent, but blinking is being ignored, you can instead invert the colors with 7:

echo  -e "\033[33;7mTitle of the Program\033[0m"

Or you can use blinking and inversion of colors (and yellow):

echo  -e "\033[33;5;7mTitle of the Program\033[0m"