echo(1)

來源:互聯網
上載者:User

標籤:echo

ECHO(1)                          User Commands                         ECHO(1)


NAME

       echo - display a line of text


SYNOPSIS

       echo [OPTION]... [STRING]...


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(被認可):


       \0NNN  the character whose ASCII code is NNN (octal)


       \\     backslash


       \a     alert (BEL)


       \b     backspace


       \c     suppress trailing newline#禁止尾隨的分行符號


       \f     form feed#換頁符


       \n     new line


       \r     carriage return


       \t     horizontal(水平的) tab


       \v     vertical(垂直的) tab


       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-

       mentation for details about the options it supports.


echo 5.97                        February 2010                         ECHO(1)


實戰演練:

[[email protected] ~]$ echo "123456789"

123456789

[[email protected] ~]$ echo "123\t456\v789"

123\t456\v789#預設情況下不對加反斜線轉義的字元進行解釋

[[email protected] ~]$ echo -e "123\t456\v789"

123     456

           789

  

#注意觀察斷行符號符(\r)和分行符號(\n)的區別

[[email protected] ~]$ echo -e "123\n456\r789"

123

789

[[email protected] ~]$ echo -e "123\n 456\r789"

123

7896

[[email protected] ~]$ echo -e "123\n   456\r789"

123

789456


本文出自 “古柏的部落格” 部落格,請務必保留此出處http://444546012.blog.51cto.com/8578922/1549151

echo(1)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.