📄 command.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>command</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="command"></a> <a name="tag_04_24"></a><!-- command --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_24_01"></a>NAME</h4><blockquote>command - execute a simple command</blockquote><h4><a name="tag_04_24_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>command</tt> <b>[</b><tt>-p</tt><b>]</b> <i>command_name</i> <b>[</b><i>argument</i> <tt>...</tt><b>]</b><tt><br><br></tt></code></p><div class="box"><code><tt><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> command</tt> <b>[</b> <tt>-v | -V</tt> <b>]</b> <i>command_name</i><tt><img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_04_24_03"></a>DESCRIPTION</h4><blockquote><p>The <i>command</i> utility shall cause the shell to treat the arguments as a simple command, suppressing the shell functionlookup that is described in <a href="xcu_chap02.html#tag_02_09_01_01"><i>Command Search and Execution</i></a> , item 1b.</p><p>If the <i>command_name</i> is the same as the name of one of the special built-in utilities, the special properties in theenumerated list at the beginning of <a href="xcu_chap02.html#tag_02_14"><i>Special Built-In Utilities</i></a> shall not occur. Inevery other respect, if <i>command_name</i> is not the name of a function, the effect of <i>command</i> (with no options) shall bethe same as omitting <i>command</i>.</p><p>On systems supporting the User Portability Utilities option, the <i>command</i> utility also shall provide informationconcerning how a command name is interpreted by the shell; see <b>-v</b> and <b>-V</b>.</p></blockquote><h4><a name="tag_04_24_04"></a>OPTIONS</h4><blockquote><p>The <i>command</i> utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>.</p><p>The following options shall be supported:</p><dl compact><dt><b>-p</b></dt><dd>Perform the command search using a default value for <i>PATH</i> that is guaranteed to find all of the standard utilities.</dd><dt><b>-v</b></dt><dd>(On systems supporting the User Portability Utilities option.) Write a string to standard output that indicates the pathname orcommand that will be used by the shell, in the current shell execution environment (see <a href="xcu_chap02.html#tag_02_12"><i>Shell Execution Environment</i></a> ), to invoke <i>command_name</i>, but do not invoke<i>command_name</i>. <ul><li><p>Utilities, regular built-in utilities, <i>command_name</i>s including a slash character, and any implementation-definedfunctions that are found using the <i>PATH</i> variable (as described in <a href="xcu_chap02.html#tag_02_09_01_01"><i>CommandSearch and Execution</i></a> ), shall be written as absolute pathnames.</p></li><li><p>Shell functions, special built-in utilities, regular built-in utilities not associated with a <i>PATH</i> search, and shellreserved words shall be written as just their names.</p></li><li><p>An alias shall be written as a command line that represents its alias definition.</p></li><li><p>Otherwise, no output shall be written and the exit status shall reflect that the name was not found.</p></li></ul></dd><dt><b>-V</b></dt><dd>(On systems supporting the User Portability Utilities option.) Write a string to standard output that indicates how the namegiven in the <i>command_name</i> operand will be interpreted by the shell, in the current shell execution environment (see <a href="xcu_chap02.html#tag_02_12"><i>Shell Execution Environment</i></a> ), but do not invoke <i>command_name</i>. Although the format ofthis string is unspecified, it shall indicate in which of the following categories <i>command_name</i> falls and shall include theinformation stated: <ul><li><p>Utilities, regular built-in utilities, and any implementation-defined functions that are found using the <i>PATH</i> variable(as described in <a href="xcu_chap02.html#tag_02_09_01_01"><i>Command Search and Execution</i></a> ), shall be identified as suchand include the absolute pathname in the string.</p></li><li><p>Other shell functions shall be identified as functions.</p></li><li><p>Aliases shall be identified as aliases and their definitions included in the string.</p></li><li><p>Special built-in utilities shall be identified as special built-in utilities.</p></li><li><p>Regular built-in utilities not associated with a <i>PATH</i> search shall be identified as regular built-in utilities. (The term"regular" need not be used.)</p></li><li><p>Shell reserved words shall be identified as reserved words.</p></li></ul></dd></dl></blockquote><h4><a name="tag_04_24_05"></a>OPERANDS</h4><blockquote><p>The following operands shall be supported:</p><dl compact><dt><i>argument</i></dt><dd>One of the strings treated as an argument to <i>command_name</i>.</dd><dt><i>command_name</i></dt><dd><br>The name of a utility or a special built-in utility.</dd></dl></blockquote><h4><a name="tag_04_24_06"></a>STDIN</h4><blockquote><p>Not used.</p></blockquote><h4><a name="tag_04_24_07"></a>INPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_24_08"></a>ENVIRONMENT VARIABLES</h4><blockquote><p>The following environment variables shall affect the execution of <i>command</i>:</p><dl compact><dt><i>LANG</i></dt><dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume ofIEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> forthe precedence of internationalization variables used to determine the values of locale categories.)</dd><dt><i>LC_ALL</i></dt><dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd><dt><i>LC_CTYPE</i></dt><dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte asopposed to multi-byte characters in arguments).</dd><dt><i>LC_MESSAGES</i></dt><dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error andinformative messages written to standard output.</dd><dt><i>NLSPATH</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><i>PATH</i></dt><dd>Determine the search path used during the command search described in <a href="xcu_chap02.html#tag_02_09_01_01"><i>CommandSearch and Execution</i></a> , except as described under the <b>-p</b> option.</dd></dl></blockquote><h4><a name="tag_04_24_09"></a>ASYNCHRONOUS EVENTS</h4><blockquote><p>Default.</p></blockquote><h4><a name="tag_04_24_10"></a>STDOUT</h4><blockquote><p>When the <b>-v</b> option is specified, standard output shall be formatted as:</p><pre><tt>"%s\n", <</tt><i>pathname or command</i><tt>></tt></pre><p>When the <b>-V</b> option is specified, standard output shall be formatted as:</p><pre><tt>"%s\n", <</tt><i>unspecified</i><tt>></tt></pre></blockquote><h4><a name="tag_04_24_11"></a>STDERR</h4><blockquote><p>The standard error shall be used only for diagnostic messages.</p></blockquote><h4><a name="tag_04_24_12"></a>OUTPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_24_13"></a>EXTENDED DESCRIPTION</h4><blockquote><p>None.</p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -