echo
If -e is in effect, the following sequences are recognized:
\ backslash
a alert (BEL)
b backspace
c produce no further output
e escape
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
NNN byte with octal value NNN (1 to 3 digits)
xHH byte with hexadecimal value HH (1 to 2 digits)
echo -e "linuxea.com nwww.linuxea.com"[root@zabbix_agentd ~]# echo -e "linuxea.com nwww.linuxea.com"linuxea.com www.linuxea.com[root@zabbix_agentd ~]#
[root@zabbix_agentd ~]# echo -e "linuxea.com nwww.linuxea.com"linuxea.com www.linuxea.com-t制表符[root@zabbix_agentd ~]# echo -e "linuxea.com twww.linuxea.com"linuxea.com www.linuxea.com垂直制表符-v[root@zabbix_agentd ~]# echo -e "linuxea.com vwww.linuxea.com"linuxea.com
www.linuxea.com
b删除前一个字符[root@zabbix_agentd ~]# echo -e "linuxea.com bwww.linuxea.com"linuxea.comwww.linuxea.com[root@zabbix_agentd ~]# echo -e "linuxea.com awww.linuxea.com"linuxea.com www.linuxea.com[root@zabbix_agentd ~]# echo -e "linuxea.com www.linuxea.com"
多种颜色[root@zabbix_agentd ~]# echo -e " 33[31mwww.linuxea.com 33[0m"www.linuxea.com[root@zabbix_agentd ~]# 33[31mwww.linuxea.com 33[0m 33颜色控制字符开始3表示背景色1m是前景色 ,范围1-7引用颜色的字符 33颜色控制符结束 0m可以用;号隔开在可以这样:echo -e " 33[31;1;42;5mwww.linuxea.com 33[0m"
-n不自动换行[root@zabbix_agentd ~]# echo -ne " 33[31;1;42;5mwww.linuxea.com 33[0m"www.linuxea.com[root@zabbix_agentd ~]#
shell中的引用‘’:强引用,变量替换不会进行“”:弱引用,能够执行变量替换``:命令替换,引用命令的执行结echo date +%F-%T