📄 fc.html
字号:
the 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 and input files).</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 standarderror.</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></dl></blockquote><h4><a name="tag_04_52_09"></a>ASYNCHRONOUS EVENTS</h4><blockquote><p>Default.</p></blockquote><h4><a name="tag_04_52_10"></a>STDOUT</h4><blockquote><p>When the <b>-l</b> option is used to list commands, the format of each command in the list shall be as follows:</p><pre><tt>"%d\t%s\n", <</tt><i>line number</i><tt>>, <</tt><i>command</i><tt>></tt></pre><p>If both the <b>-l</b> and <b>-n</b> options are specified, the format of each command shall be:</p><pre><tt>"\t%s\n", <</tt><i>command</i><tt>></tt></pre><p>If the <<i>command</i>> consists of more than one line, the lines after the first shall be displayed as:</p><pre><tt>"\t%s\n", <</tt><i>continued-command</i><tt>></tt></pre></blockquote><h4><a name="tag_04_52_11"></a>STDERR</h4><blockquote><p>The standard error shall be used only for diagnostic messages.</p></blockquote><h4><a name="tag_04_52_12"></a>OUTPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_52_13"></a>EXTENDED DESCRIPTION</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_52_14"></a>EXIT STATUS</h4><blockquote><p>The following exit values shall be returned:</p><dl compact><dt> 0</dt><dd>Successful completion of the listing.</dd><dt>>0</dt><dd>An error occurred.</dd></dl><p>Otherwise, the exit status shall be that of the commands executed by <i>fc</i>.</p></blockquote><h4><a name="tag_04_52_15"></a>CONSEQUENCES OF ERRORS</h4><blockquote><p>Default.</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_04_52_16"></a>APPLICATION USAGE</h4><blockquote><p>Since editors sometimes use file descriptors as integral parts of their editing, redirecting their file descriptors as part ofthe <i>fc</i> command can produce unexpected results. For example, if <a href="../utilities/vi.html"><i>vi</i></a> is the<i>FCEDIT</i> editor, the command:</p><pre><tt>fc -s | more</tt></pre><p>does not work correctly on many systems.</p><p>Users on windowing systems may want to have separate history files for each window by setting <i>HISTFILE</i> as follows:</p><pre><tt>HISTFILE=$HOME/.sh_hist$$</tt></pre></blockquote><h4><a name="tag_04_52_17"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_52_18"></a>RATIONALE</h4><blockquote><p>This utility is based on the <i>fc</i> built-in of the KornShell.</p><p>An early proposal specified the <b>-e</b> option as <b>[-e</b> <i>editor</i> <b>[</b> <i>old</i> = <i>new</i> <b>]]</b>, whichis not historical practice. Historical practice in <i>fc</i> of either <b>[-e</b> <i>editor</i> <b>]</b> or <b>[-e - [</b><i>old</i> = <i>new</i> <b>]]</b> is acceptable, but not both together. To clarify this, a new option <b>-s</b> was introducedreplacing the <b>[-e -]</b>. This resolves the conflict and makes <i>fc</i> conform to the Utility Syntax Guidelines.</p><dl compact><dt><i>HISTFILE</i></dt><dd>Some implementations of the KornShell check for the superuser and do not create a history file unless <i>HISTFILE</i> is set.This is done primarily to avoid creating unlinked files in the root file system when logging in during single-user mode.<i>HISTFILE</i> must be set for the superuser to have history.</dd><dt><i>HISTSIZE</i></dt><dd>Needed to limit the size of history files. It is the intent of the standard developers that when two shells share the samehistory file, commands that are entered in one shell shall be accessible by the other shell. Because of the difficulties ofsynchronization over a network, the exact nature of the interaction is unspecified.</dd></dl><p>The initialization process for the history file can be dependent on the system start-up files, in that they may contain commandsthat effectively preempt the settings the user has for <i>HISTFILE</i> and <i>HISTSIZE .</i> For example, function definitioncommands are recorded in the history file. If the system administrator includes function definitions in some system start-up filecalled before the <i>ENV</i> file, the history file is initialized before the user can influence its characteristics. In somehistorical shells, the history file is initialized just after the <i>ENV</i> file has been processed. Because of these situations,the text requires the initialization process to be implementation-defined.</p><p>Consideration was given to omitting the <i>fc</i> utility in favor of the command line editing feature in <a href="../utilities/sh.html"><i>sh</i></a>. For example, in <a href="../utilities/vi.html"><i>vi</i></a> editing mode, typing<tt>"<ESC> v"</tt> is equivalent to:</p><pre><tt>EDITOR=vi fc</tt></pre><p>However, the <i>fc</i> utility allows the user the flexibility to edit multiple commands simultaneously (such as <i>fc</i> 1020) and to use editors other than those supported by <a href="../utilities/sh.html"><i>sh</i></a> for command line editing.</p><p>In the KornShell, the alias <b>r</b> (``re-do") is preset to <i>fc</i> <b>-e -</b> (equivalent to the POSIX <i>fc</i><b>-s</b>). This is probably an easier command name to remember than <i>fc</i> (``fix command"), but it does not meet the UtilitySyntax Guidelines. Renaming <i>fc</i> to <i>hist</i> or <i>redo</i> was considered, but since this description closely matcheshistorical KornShell practice already, such a renaming was seen as gratuitous. Users are free to create aliases whenever oddhistorical names such as <i>fc</i>, <a href="../utilities/awk.html"><i>awk</i></a>, <a href="../utilities/cat.html"><i>cat</i></a>,<a href="../utilities/grep.html"><i>grep</i></a>, or <a href="../utilities/yacc.html"><i>yacc</i></a> are standardized byPOSIX.</p><p>Command numbers have no ordering effects; they are like serial numbers. The <b>-r</b> option and -<i>number</i> operand addressthe sequence of command execution, regardless of serial numbers. So, for example, if the command number wrapped back to 1 at somearbitrary point, there would be no ambiguity associated with traversing the wrap point. For example, if the command historywere:</p><pre><tt>32766: echo 132767: echo 21: echo 3</tt></pre><p>the number -2 refers to command 32767 because it is the second previous command, regardless of serial number.</p></blockquote><h4><a name="tag_04_52_19"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_52_20"></a>SEE ALSO</h4><blockquote><p><a href="sh.html"><i>sh</i></a></p></blockquote><h4><a name="tag_04_52_21"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 4.</p></blockquote><h4><a name="tag_04_52_22"></a>Issue 5</h4><blockquote><p>The FUTURE DIRECTIONS section is added.</p></blockquote><h4><a name="tag_04_52_23"></a>Issue 6</h4><blockquote><p>This utility is marked as part of the User Portability Utilities option.</p><p>In the ENVIRONMENT VARIABLES section, the text "user's home directory" is updated to "directory referred to by the<i>HOME</i> environment variable".</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -