標籤: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)