echo -e "this is line1\c"  "excepted:this is also the line1"

---->this is line1

=======为什么会这样呢

man  echo 后发现 在echo -e 后,对“\c” 的解释是:produce no further output  不产生进一步的输出   ----》自己理解是在\c 后,这一行后面的内容都不会输出,直接删掉了

 

再次测试

echo -e "this is line1 \c  these word will disappear"

---->this is line1

 

完全正确!!!

 

【produce

[prəˈdju:s]       [prəˈdu:s]     

vt.& vi.   产生;       生产;       制作;       创作   

vt.   制造;       出示;       引起;       [经济学]生利   

n.   产品;       产量;       产额;       结果   

网络 发生;   农产品;  】

 

echo  "test1" test2 "test3"

---->test1 test2 test3

 

echo -e  "this is line1\n"  "Excepted:this is line2"

---->this is line1

---->this is line2

 

man echo:

 

ECHO(1)                          User Commands                         ECHO(1)

NAME        echo - display a line of text

SYNOPSIS        echo [SHORT-OPTION]... [STRING]...        echo LONG-OPTION

DESCRIPTION        Echo the STRING(s) to standard output.

       -n     do not output the trailing newline

       -e     enable interpretation of backslash escapes

       -E     disable interpretation of backslash escapes (default)

       --help display this help and exit

       --version               output version information and exit

       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

       \0NNN  byte with octal value NNN (1 to 3 digits)

       \xHH   byte with hexadecimal value HH (1 to 2 digits)

       NOTE: your shell may have its own version of echo, which usually super‐        sedes the version described here.  Please refer to your  shell's  docu‐

 

 

 

【转】http://www.cnblogs.com/perfy/archive/2012/07/24/2605903.html

 

 

linux的echo命令, 在shell编程中极为常用, 在终端下打印变量value的时候也是常常用到的, 因此有必要了解下echo的用法
echo命令的功能是在显示器上显示一段文字,一般起到一个提示的作用。 该命令的一般格式为: echo [ -n ] 字符串 其中选项n表示输出文字后不换行;字符串能加引号,也能不加引号。用echo命令输出加引号的字符串时,将字符串原样输出;用echo命令输出不加引号的字符串时,将字符串中的各个单词作为字符串输出,各字符串之间用一个空格分割。
功能说明:显示文字。 语   法:echo [-ne][字符串]或 echo [--help][--version] 补充说明:echo会将输入的字符串送往标准输出。输出的字符串间以空白字符隔开, 并在最后加上换行号。 参   数:-n 不要在最后自动换行 -e 若字符串中出现以下字符,则特别加以处理,而不会将它当成一般 文字输出:    \a 发出警告声;    \b 删除前一个字符;    \c 最后不加上换行符号;    \f 换行但光标仍旧停留在原来的位置;    \n 换行且光标移至行首;    \r 光标移至行首,但不换行;    \t 插入tab;    \v 与\f相同;    \\ 插入\字符;    \nnn 插入nnn(八进制)所代表的ASCII字符; –help 显示帮助 –version 显示版本信息

 

 

-----------------------------------------------------------------------------------------------

 

Linux的echo命令, 在shell编程中极为常用, 在终端下打印变量value的时候也是常常用到。

比如:echo可用作显示注释,用于一些批命令中需要注释给用户看的地方,比如前一条命令执行会花很长时间,常会用echo显示一条信息让用户知道这个时候比较慢,稍微等待一会。

在Linux中echo命令用来在标准输出上显示一段字符,比如: echo "the echo command test!"

这个就会输出“the echo command test!”这一行文字! 

echo "the echo command test!">a.sh 这个就会在a.sh文件中输出“the echo command test!”这一行文字! 该命令的一般格式为: echo [ -n ] 字符串其中选项n表示输出文字后不换行;字符串能加引号,也能不加引号。用echo命令输出加引号的字符串时,将字符串原样输出;用echo命令输出不加引号的字符串时,将字符串中的各个单词作为字符串输出,各字符串之间用一个空格分割。