0.echo Command entry: (Default bash support, CSH not supported)
-N does not output line breaks
-E Open backslash ESC escape
-e Suppress backslash ESC escape (default)
Both 1.echo and printf can print output information, except that Echo adds a newline character (\ n) by default;
Echo-n "XXXX" can also cancel line break
2.echo can open the escape character through-E, such as the output Color command;
#!/bin/bash
# first define some colors: 1 is the highlight
Red= ' \e[0;31m ' # red
Red= ' \e[1;31m '
Green= ' \e[0;32m ' # Green
Green= ' \e[1;32m '
yellow= ' \e[0;33m ' # Yellow
yellow= ' \e[1;33m '
Blue= ' \e[0;34m ' # Blue
Blue= ' \e[1;34m '
Purple= ' \e[0;35m ' # purple
Purple= ' \e[1;35m '
Cyan= ' \e[0;36m ' # blue-Green
Cyan= ' \e[1;36m '
White= ' \e[1;37m ' # White
Nc= ' \e[0m ' # no Color
Echo-e "${cyan}this is BASH ${red}${bash_version%.*}${cyan}-DISPLAY on ${red} $DISPLAY ${nc}\n"
Echo-e "${red}red ${blue}blue ${cyan}cyan ${green}green${nc}"
ref:1.http://nigelzeng.iteye.com/blog/1456678
2.http://hi.baidu.com/lonelycorn/item/c7472d4bc25127ea1e19bc96