BASH – Кольоровий текст

#text
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White

# background
white_bg='\e[47m'
black_bg='\e[40m'

# using examples
echo -e "${txtred}black test"
echo -e "${white_bg}white bg and black test${black_bg}"
echo -e "${txtblu}yellow test${txtwht}"

Related posts

Leave a Comment