⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0012-0012.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Complete Command Reference:User Commands:EarthWeb Inc.-</TITLE>

</HEAD>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311046 //-->

<!-- TITLE=Linux Complete Command Reference//-->

<!-- AUTHOR=Red Hat//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=01 //-->

<!-- PAGES=0001-0736 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->



<P><CENTER>

<a href="0009-0011.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0013-0014.html">Next</A></CENTER></P>







<A NAME="PAGENUM-12"><P>Page 12</P></A>





<B>

<P>DEFINITIONS</P>

</B>





<TABLE>



<TR><TD>

blank

</TD><TD>

A space or tab.

</TD></TR><TR><TD>

word

</TD><TD>

A sequence of characters considered as a single unit by the shell. Also known as a token.

</TD></TR><TR><TD>

name

</TD><TD>

A word consisting only of alphanumeric characters and underscores and beginning with

an alphabetic character or an underscore. Also referred to as an identifier.

</TD></TR><TR><TD>

meta character

</TD><TD>

A character that, when unquoted, separates words. One of the following:

</TD></TR><TR><TD>

</TD><TD>

|, &amp;, ;, (, ), &lt;, &gt;, space, tab

</TD></TR><TR><TD>

control operator

</TD><TD>

A token that performs a control function. It is one of the following symbols:

</TD></TR><TR><TD>

</TD><TD>

||, &amp;, &amp;&amp;, ;, ;;, (, ), |, &lt;newline&gt;

</TD></TR></TABLE>



<B>

<P>RESERVED WORDS</P>

</B>



<P>Reserved words are words that have a special meaning to the shell. The following words are recognized as reserved

when unquoted and either the first word of a simple command (see &quot;Shell Grammar,&quot; next) or the third word of a case or

for command:

</P>



<!-- CODE SNIP //-->

<PRE>

! case  do done elif else esac fi for function if in select then until while { }

</PRE>

<!-- END CODE SNIP //-->



<B>

<P>SHELL GRAMMAR</P>

</B>



<P><B>

SIMPLE COMMANDS

</P></B>



<P>A simple command is a sequence of optional variable assignments followed by words and redirections separated by blank

and terminated by a control operator. The first word specifies the command to be executed. The remaining words are passed

as arguments to the invoked command.

</P>



<P>The return value of a simple command is its exit status, or

128+n if the command is terminated by signal n.

</P>





<P><B>

PIPELINES

</P></B>





<P>A pipeline is a sequence of one or more commands separated by the character |. The format for a pipeline is

</P>



<!-- CODE SNIP //-->

<PRE>

 [!]command [ | command2 ... ]

</PRE>

<!-- END CODE SNIP //-->



<P>The standard output of command is connected to the standard input of

command2. This connection is performed before any redirections specified by the command. (See the &quot;Redirection&quot; section, later in this manual page.)

<P>If the reserved word ! precedes a pipeline, the exit status of that pipeline is the logical

NOT of the exit status of the last command. Otherwise, the status of the pipeline is the exit status of the last command. The shell waits for all commands

in the pipeline to terminate before returning a value.

<P>Each command in a pipeline is executed as a separate process (that is, in a subshell).



<B>

<P>LISTS</P>

</B>



<P>A list is a sequence of one or more pipelines separated by one of these operators:

;, &amp;, &amp;&amp;, or ||, and terminated by one

of these: ;, &amp;, or &lt;newline&gt;.

</P>



<P>Of these list operators, &amp;&amp; and || have equal precedence, followed by

; and &amp;, which have equal precedence.

</P>



<P>If a command is terminated by the control operator

&amp;, the shell executes the command in the background in a subshell.

The shell does not wait for the command to finish, and the return status is

0. Commands separated by a ; are executed sequentially; the shell waits for each command to terminate in turn. The return status is the exit status of the last

command executed.

</P>





<P>The control operators &amp;&amp; and || denote

AND lists and OR lists, respectively. An AND list has the form:

</P>



<!-- CODE SNIP //-->

<PRE>

command &amp;&amp; command2

</PRE>

<!-- END CODE SNIP //-->





<P>command2 is executed if, and only if, command returns an exit status of

Zero.

</P>







<P><CENTER>

<a href="0009-0011.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0013-0014.html">Next</A></CENTER></P>







</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -