How to color a paragraph of text in a shell script

Common colors for shell scripts are as follows:

30: black
31: red
32: green
33: yellow
34: blue
35: purple
36: dark green
37: white

echo -e "\033[31m red word\033[0m"
echo -e "\033[32m green word\033[0m"
echo -e "\033[33m yellow word\033[0m"
echo -e "\ 033[34m blue word\033[0m"

Make the font turn red and keep flashing:
echo -e "\033[31m \033[05m flashing and turning red\033[0m"
echo -e "\E[31;5 flashing and turning red\E[0m "

If you use too many colors, it is recommended to use variables instead of
Red_color ='\033[31m'
End_color ='\033[0m'
echo -e "${Red_color font becomes red${End_color}}"

Guess you like

Origin blog.51cto.com/15013163/2573741