📄 echo.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>echo</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_510"> </a>NAME</h4><blockquote>echo - write arguments to standard output</blockquote><h4><a name = "tag_001_014_511"> </a>SYNOPSIS</h4><blockquote><pre><code>echo <b>[</b><i>string</i> ...<b>]</b></code></pre></blockquote><h4><a name = "tag_001_014_512"> </a>DESCRIPTION</h4><blockquote>The<i>echo</i>utility will write its arguments to standard output,followed by a newline character.If there are no arguments, only the newline character will be written.</blockquote><h4><a name = "tag_001_014_513"> </a>OPTIONS</h4><blockquote>The<i>echo</i>utility will not recognise the--argument in the manner specified by Guideline 10 of the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b> </a> ;--will be recognised as a string operand.<p>Implementations will not support any options.</blockquote><h4><a name = "tag_001_014_514"> </a>OPERANDS</h4><blockquote>The following operands are supported:<dl compact><dt><i>string</i><dd>A string to be written to standard output.If any operand is-n,it will be treated as a string, not an option.The following character sequences will berecognised within any of the arguments:<dl compact><dt><b>\a</b><dd>Write analertcharacter.<dt><b>\b</b><dd>Write abackspacecharacter.<dt><b>\c</b><dd>Suppress thenewlinecharacter that otherwise followsthe final argument in the output.All characters following the\cin the arguments will be ignored.<dt><b>\f</b><dd>Write aform-feedcharacter.<dt><b>\n</b><dd>Write anewlinecharacter.<dt><b>\r</b><dd>Write acarriage-returncharacter.<dt><b>\t</b><dd>Write atabcharacter.<dt><b>\v</b><dd>Write avertical-tabcharacter.<dt><b>\\</b><dd>Write abackslashcharacter.<dt><b>\0</b><i>num</i><dd>Write an 8-bit value that is the zero-, one-, two- orthree-digit octal number<i>num .</i></dl><p></dl></blockquote><h4><a name = "tag_001_014_515"> </a>STDIN</h4><blockquote>Not used.</blockquote><h4><a name = "tag_001_014_516"> </a>INPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_517"> </a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>echo</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard error.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i></dl></blockquote><h4><a name = "tag_001_014_518"> </a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_519"> </a>STDOUT</h4><blockquote>The<i>echo</i>utility arguments will be separated by singlespace charactersand a newline character will follow the last argument.Output transformations will occur based on the escapesequences in the input; see the OPERANDS section.</blockquote><h4><a name = "tag_001_014_520"> </a>STDERR</h4><blockquote>Used only for diagnostic messages.</blockquote><h4><a name = "tag_001_014_521"> </a>OUTPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_522"> </a>EXTENDED DESCRIPTION</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_523"> </a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>Successful completion.<dt>>0<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_524"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_525"> </a>APPLICATION USAGE</h4><blockquote>It is not possible to use<i>echo</i>portably across all systems that are not XSI-conformant unless both<b>-n</b>(as the first argument)and escape sequences are omitted.<p>The<i><a href="printf.html">printf</a></i>utilitycan be used portably to emulate any ofthe traditional behaviours of the<i>echo</i>utility as follows:<ul><p><li>The XSI<i>echo</i>is equivalent to:<pre><code>printf "%b\n" "$*"</code></pre><p><li>The BSD<i>echo</i>is equivalent to:<pre><code>if [ "X$1" = "X-n" ]then shift printf "%s" "$*"else printf "%s\n" "$*"fi</code></pre><p></ul><p>New applications are encouraged to use<i><a href="printf.html">printf</a></i>instead of<i>echo</i>.</blockquote><h4><a name = "tag_001_014_526"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_527"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_528"> </a>SEE ALSO</h4><blockquote><i><a href="printf.html">printf</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -