歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux echo介紹

Linux echo介紹

日期:2017/2/28 15:34:21   编辑:Linux教程

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

Copyright © Linux教程網 All Rights Reserved