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

📄 mailx.html

📁 posix标准英文,html格式
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!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-2004 IEEE and The Open Group, All Rights Reserved --><title>mailx</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="mailx"></a> <a name="tag_04_83"></a><!-- mailx --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2004 Edition<br>Copyright &copy; 2001-2004 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_83_01"></a>NAME</h4><blockquote>mailx - process messages</blockquote><h4><a name="tag_04_83_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><h5><a name="tag_04_83_02_01"></a>Send Mode</h5><pre><tt>mailx</tt> <b>[</b><tt>-s</tt> <i>subject</i><b>]</b> <i>address</i><tt>...</tt></pre><h5><a name="tag_04_83_02_02"></a>Receive Mode</h5><pre><tt>mailx -emailx</tt> <b>[</b><tt>-HiNn</tt><b>][</b><tt>-F</tt><b>][</b><tt>-u</tt> <i>user</i><b>]</b><tt>mailx -f</tt><b>[</b><tt>-HiNn</tt><b>][</b><tt>-F</tt><b>][</b><i>file</i><b>]</b></pre></blockquote><h4><a name="tag_04_83_03"></a>DESCRIPTION</h4><blockquote><p>The <i>mailx</i> utility provides a message sending and receiving facility. It has two major modes, selected by the optionsused: Send Mode and Receive Mode.</p><p>On systems that do not support the User Portability Utilities option, an application using <i>mailx</i> shall have the abilityto send messages in an unspecified manner (Send Mode). Unless the first character of one or more lines is tilde ( <tt>'&#152;'</tt>), all characters in the input message shall appear in the delivered message, but additional characters may be inserted in themessage before it is retrieved.</p><p>On systems supporting the User Portability Utilities option, mail-receiving capabilities and other interactive features, ReceiveMode, described below, also shall be enabled.</p><h5><a name="tag_04_83_03_01"></a>Send Mode</h5><p>Send Mode can be used by applications or users to send messages from the text in standard input.</p><h5><a name="tag_04_83_03_02"></a>Receive Mode</h5><p>Receive Mode is more oriented towards interactive users. Mail can be read and sent in this interactive mode.</p><p>When reading mail, <i>mailx</i> provides commands to facilitate saving, deleting, and responding to messages. When sending mail,<i>mailx</i> allows editing, reviewing, and other modification of the message as it is entered.</p><p>Incoming mail shall be stored in one or more unspecified locations for each user, collectively called the system <i>mailbox</i>for that user. When <i>mailx</i> is invoked in Receive Mode, the system mailbox shall be the default place to find new mail. Asmessages are read, they shall be marked to be moved to a secondary file for storage, unless specific action is taken. Thissecondary file is called the <b>mbox</b> and is normally located in the directory referred to by the <i>HOME</i> environmentvariable (see <i>MBOX</i> in the ENVIRONMENT VARIABLES section for a description of this file). Messages shall remain in this fileuntil explicitly removed. When the <b>-f</b> option is used to read mail messages from secondary files, messages shall be retainedin those files unless specifically removed. All three of these locations-system mailbox, <b>mbox</b>, and secondary file-arereferred to in this section as simply &quot;mailboxes&quot;, unless more specific identification is required.</p></blockquote><h4><a name="tag_04_83_04"></a>OPTIONS</h4><blockquote><p>The <i>mailx</i> utility shall conform to the Base Definitions volume of IEEE&nbsp;Std&nbsp;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. (Only the <b>-s</b> <i>subject</i> option shall be required on all systems. The otheroptions are required only on systems supporting the User Portability Utilities option.)</p><dl compact><dt><b>-e</b></dt><dd>Test for the presence of mail in the system mailbox. The <i>mailx</i> utility shall write nothing and exit with a successfulreturn code if there is mail to read.</dd><dt><b>-f</b></dt><dd>Read messages from the file named by the <i>file</i> operand instead of the system mailbox. (See also <b>folder</b>.) If no<i>file</i> operand is specified, read messages from <b>mbox</b> instead of the system mailbox.</dd><dt><b>-F</b></dt><dd>Record the message in a file named after the first recipient. The name is the login-name portion of the address found first onthe <b>To:</b> line in the mail header. Overrides the <b>record</b> variable, if set (see <a href="#tag_04_83_13_02">InternalVariables in mailx</a>.)</dd><dt><b>-H</b></dt><dd>Write a header summary only.</dd><dt><b>-i</b></dt><dd>Ignore interrupts. (See also <b>ignore</b>.)</dd><dt><b>-n</b></dt><dd>Do not initialize from the system default start-up file. See the EXTENDED DESCRIPTION section.</dd><dt><b>-N</b></dt><dd>Do not write an initial header summary.</dd><dt><b>-s&nbsp;</b> <i>subject</i></dt><dd>Set the <b>Subject</b> header field to <i>subject</i>. All characters in the <i>subject</i> string shall appear in thedelivered message. The results are unspecified if <i>subject</i> is longer than {LINE_MAX} - 10 bytes or contains a&lt;newline&gt;.</dd><dt><b>-u&nbsp;</b> <i>user</i></dt><dd>Read the system mailbox of the login name <i>user</i>. This shall only be successful if the invoking user has the appropriateprivileges to read the system mailbox of that user.</dd></dl></blockquote><h4><a name="tag_04_83_05"></a>OPERANDS</h4><blockquote><p>The following operands shall be supported:</p><dl compact><dt><i>address</i></dt><dd>Addressee of message. When <b>-n</b> is specified and no user start-up files are accessed (see the EXTENDED DESCRIPTIONsection), the user or application shall ensure this is an address to pass to the mail delivery system. Any system or user start-upfiles may enable aliases (see <b>alias</b> under <a href="#tag_04_83_13_03">Commands in mailx</a>) that may modify the form of<i>address</i> before it is passed to the mail delivery system.</dd><dt><i>file</i></dt><dd>A pathname of a file to be read instead of the system mailbox when <b>-f</b> is specified. The meaning of the <i>file</i>option-argument shall be affected by the contents of the <b>folder</b> internal variable; see <a href="#tag_04_83_13_02">InternalVariables in mailx</a>.</dd></dl></blockquote><h4><a name="tag_04_83_06"></a>STDIN</h4><blockquote><p>When <i>mailx</i> is invoked in Send Mode (the first synopsis line), standard input shall be the message to be delivered to thespecified addresses. When in Receive Mode, user commands shall be accepted from <i>stdin</i>. If the User Portability Utilitiesoption is not supported, standard input lines beginning with a tilde ( <tt>'&#152;'</tt> ) character produce unspecifiedresults.</p><p>If the User Portability Utilities option is supported, then in both Send and Receive Modes, standard input lines beginning withthe escape character (usually tilde ( <tt>'&#152;'</tt> )) shall affect processing as described in <a href="#tag_04_83_13_49">Command Escapes in mailx</a>.</p></blockquote><h4><a name="tag_04_83_07"></a>INPUT FILES</h4><blockquote><p>When <i>mailx</i> is used as described by this volume of IEEE&nbsp;Std&nbsp;1003.1-2001, the <i>file</i> option-argument (seethe <b>-f</b> option) and the <b>mbox</b> shall be text files containing mail messages, formatted as described in the OUTPUT FILESsection. The nature of the system mailbox is unspecified; it need not be a file.</p></blockquote><h4><a name="tag_04_83_08"></a>ENVIRONMENT VARIABLES</h4><blockquote><p>The following environment variables shall affect the execution of <i>mailx</i>:</p><dl compact><dt><i>DEAD</i></dt><dd>Determine the pathname of the file in which to save partial messages in case of interrupts or delivery errors. The defaultshall be <b>dead.letter</b> in the directory named by the <i>HOME</i> variable. The behavior of <i>mailx</i> in saving partialmessages is unspecified if the User Portability Utilities option is not supported and <i>DEAD</i> is not defined with the value<b>/dev/null</b>.</dd><dt><i>EDITOR</i></dt><dd>Determine the name of a utility to invoke when the <b>edit</b> (see <a href="#tag_04_83_13_03">Commands in mailx</a>) or<b>&#152;e</b> (see <a href="#tag_04_83_13_49">Command Escapes in mailx</a>) command is used. The default editor is unspecified.<sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">&nbsp;On XSI-conformant systems it is <a href="../utilities/ed.html"><i>ed</i></a>. <img src="../images/opt-end.gif" alt="[Option End]" border="0"> The effects of this variable are unspecified if the User Portability Utilities option is notsupported.</dd><dt><i>HOME</i></dt><dd>Determine the pathname of the user's home directory.</dd><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&nbsp;Std&nbsp;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 and input files) and the handling of case-insensitive address and header-fieldcomparisons.</dd><dt><i>LC_TIME</i></dt><dd>Determine the format and contents of the date and time strings written by <i>mailx</i>.</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>LISTER</i></dt><dd>Determine a string representing the command for writing the contents of the <b>folder</b> directory to standard output when the<b>folders</b> command is given (see <b>folders</b> in <a href="#tag_04_83_13_03">Commands in mailx</a>). Any string acceptable asa <i>command_string</i> operand to the <a href="../utilities/sh.html"><i>sh</i></a> <b>-c</b> command shall be valid. If thisvariable is null or not set, the output command shall be <a href="../utilities/ls.html"><i>ls</i></a>. The effects of this variableare unspecified if the User Portability Utilities option is not supported.</dd><dt><i>MAILRC</i></dt><dd>Determine the pathname of the start-up file. The default shall be <b>.mailrc</b> in the directory referred to by the<i>HOME</i> environment variable. The behavior of <i>mailx</i> is unspecified if the User Portability Utilities option is notsupported and <i>MAILRC</i> is not defined with the value <b>/dev/null</b>.</dd><dt><i>MBOX</i></dt><dd>Determine a pathname of the file to save messages from the system mailbox that have been read. The <b>exit</b> command shalloverride this function, as shall saving the message explicitly in another file. The default shall be <b>mbox</b> in the directorynamed by the <i>HOME</i> variable. The effects of this variable are unspecified if the User Portability Utilities option is notsupported.</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>PAGER</i></dt><dd>Determine a string representing an output filtering or pagination command for writing the output to the terminal. Any stringacceptable as a <i>command_string</i> operand to the <a href="../utilities/sh.html"><i>sh</i></a> <b>-c</b> command shall be valid.When standard output is a terminal device, the message output shall be piped through the command if the <i>mailx</i> internalvariable <b>crt</b> is set to a value less the number of lines in the message; see <a href="#tag_04_83_13_02">Internal Variables inmailx</a>. If the <i>PAGER</i> variable is null or not set, the paginator shall be either <a href="../utilities/more.html"><i>more</i></a> or another paginator utility documented in the system documentation. The effects of thisvariable are unspecified if the User Portability Utilities option is not supported.</dd><dt><i>SHELL</i></dt><dd>Determine the name of a preferred command interpreter. The default shall be <a href="../utilities/sh.html"><i>sh</i></a>. Theeffects of this variable are unspecified if the User Portability Utilities option is not supported.</dd><dt><i>TERM</i></dt><dd>If the internal variable <b>screen</b> is not specified, determine the name of the terminal type to indicate in an unspecifiedmanner the number of lines in a screenful of headers. If <i>TERM</i> is not set or is set to null, an unspecified default terminaltype shall be used and the value of a screenful is unspecified. The effects of this variable are unspecified if the UserPortability Utilities option is not supported.</dd><dt><i>TZ</i></dt><dd>This variable may determine the timezone used to calculate date and time strings written by <i>mailx</i>. If <i>TZ</i> is unsetor null, an unspecified default timezone shall be used.</dd><dt><i>VISUAL</i></dt><dd>Determine a pathname of a utility to invoke when the <b>visual</b> command (see <a href="#tag_04_83_13_03">Commands inmailx</a>) or <b>&#152;v</b> command-escape (see <a href="#tag_04_83_13_49">Command Escapes in mailx</a>) is used. If thisvariable is null or not set, the full-screen editor shall be <a href="../utilities/vi.html"><i>vi</i></a>. The effects of thisvariable are unspecified if the User Portability Utilities option is not supported.</dd></dl></blockquote><h4><a name="tag_04_83_09"></a>ASYNCHRONOUS EVENTS</h4><blockquote><p>When <i>mailx</i> is in Send Mode and standard input is not a terminal, it shall take the standard action for all signals.</p><p>In Receive Mode, or in Send Mode when standard input is a terminal, if a SIGINT signal is received:</p><ol><li><p>If in command mode, the current command, if there is one, shall be aborted, and a command-mode prompt shall be written.</p></li><li><p>If in input mode:</p><ol type="a"><li><p>If <b>ignore</b> is set, <i>mailx</i> shall write <tt>"@\n"</tt>, discard the current input line, and continue processing,bypassing the message-abort mechanism described in item 2b.</p></li><li><p>If the interrupt was received while sending mail, either when in Receive Mode or in Send Mode, a message shall be written, andanother subsequent interrupt, with no other intervening characters typed, shall be required to abort the mail message. If inReceive Mode and another interrupt is received, a command-mode prompt shall be written. If in Send Mode and another interrupt isreceived, <i>mailx</i> shall terminate with a non-zero status.</p>

⌨️ 快捷键说明

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