1,用途:
1)打印信息,包括:变量的值、字符串等
2)shell编程中,帮助debug程序
2,常用参数:
-n:打印信息之后不换行
-e:对字符串转义
3,例子:
例子一:
[root@localhost ~]# echo $LANG
zh_CN.UTF-8
例子二:
[root@localhost ~]# echo -n "please input your name: ";read name;echo "your name is:$name"
please input your name: think
your name is:think
例子三:
[root@localhost ~]# echo -e "hello\fworld"
hello
world