157 lines
5.8 KiB
HTML
157 lines
5.8 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content=
|
|
"text/html; charset=utf-8">
|
|
<title>xargs - Construct argument lists and invoke utility</title>
|
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</HEAD>
|
|
<body bgcolor="#FFFFFF">
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
|
|
|
|
<h2>xargs - Construct argument lists and invoke utility</h2>
|
|
|
|
<p><strong>Synopsis</strong></p>
|
|
|
|
<p>
|
|
<strong>xargs [-t]
|
|
[-e[</strong><em>eofstring</em><strong>]] [-E</strong> <em>eofstring</em><strong>]
|
|
[-l[</strong><em>number</em> <strong>]] [-L</strong> <em>number</em><strong>]
|
|
[-n</strong> <em>number</em><strong> [-x]]
|
|
[-s</strong> <em>size</em><strong>]</strong> [<em>utility</em>
|
|
[<em>arguments</em> ...]]
|
|
</p>
|
|
|
|
<p><strong>Description</strong></p>
|
|
|
|
<p>The <strong>xargs</strong> utility reads space, tab, newline and
|
|
end-of-file delimited <em>arguments</em> from the standard input
|
|
and runs the specified <em>utility</em> with them as arguments.</p>
|
|
|
|
<p>The <em>utility</em> and any <em>arguments</em> specified on the
|
|
command line are given to the <em>utility</em> upon each
|
|
invocation, followed by some number of the <em>arguments</em> read
|
|
from standard input. The <em>utility</em> is repeatedly run until
|
|
standard input is exhausted.</p>
|
|
|
|
<p>Spaces, tabs and newlines may be embedded in arguments using
|
|
single (') or double (") quotation marks or backslashes (\). Single quotation marks
|
|
escape all non-single quotation mark characters, excluding newlines, up to
|
|
the matching single quotation marks. Double quotation marks escape all non-double
|
|
quotation mark characters, excluding newlines, up to the matching double
|
|
quotation marks. Any single character, including newlines, may be escaped by
|
|
a backslash.</p>
|
|
|
|
<p>If no <em>utility</em> is specified, <strong>echo</strong> is
|
|
used by default.</p>
|
|
|
|
<p>Undefined behavior may occur if <em>utility</em> reads from the
|
|
standard input.</p>
|
|
|
|
<p>The <strong>xargs</strong> utility exits immediately (without
|
|
processing any further input) if a command line cannot be
|
|
assembled, <em>utility</em> cannot be invoked, an invocation of the
|
|
<em>utility</em> is ended by a signal, or an invocation of the <em>
|
|
utility</em> exits with a value of 255.</p>
|
|
|
|
<p><strong>Options</strong></p>
|
|
|
|
<dl>
|
|
<dt>
|
|
<strong>-E</strong> <em>eofstring</em></dt>
|
|
|
|
<dd>Specify a logical end-of-file string.
|
|
<strong>xargs</strong> reads standard input until either end-of-file or the logical
|
|
end-of-file string is encountered.</dd>
|
|
|
|
<dt><strong>-e[</strong><em>eofstring</em><strong>]</strong></dt>
|
|
|
|
<dd>This option is equivalent to the <strong>-E</strong> option. If <em>eofstring</em> is not
|
|
specified, the default value is _ (a single underscore).</dd>
|
|
|
|
<dt><strong>-L</strong> <em>number</em></dt>
|
|
|
|
<dd>Run <em>utility</em> for each non-empty <em>number</em> lines of arguments read from
|
|
standard input. The last invocation of <em>utility</em> will be with
|
|
fewer lines of arguments if fewer than <em>number</em> remain.
|
|
A line is considered to end with the first newline character unless the
|
|
last character of the line is a blank character. A trailing blank character signals
|
|
continuation to the next non-empty line, inclusive. The <strong>-L</strong> and
|
|
<strong>-n</strong> options are mutually exclusive. The last one
|
|
specified takes effect.</dd>
|
|
|
|
<dt><strong>-l[</strong> <em>number</em> <strong>]</strong></dt>
|
|
|
|
<dd>This option is equivalent to the <strong>-L</strong> option.
|
|
If <em>number</em> is not specified, the default value is 1.
|
|
</dd>
|
|
|
|
<dt><strong>-n</strong> <em>number</em></dt>
|
|
|
|
<dd>Set the maximum number of <em>arguments</em> read from
|
|
standard input for each invocation of the <em>utility</em>. An
|
|
invocation of <em>utility</em> will use less than <em>number</em>
|
|
standard input arguments if the number of bytes accumulated (see
|
|
the <strong>-s</strong> option) exceeds the specified size or there
|
|
are fewer than <em>number</em> arguments remaining for the last
|
|
invocation of <em>utility</em>. The maximum number of arguments
|
|
i5/OS<SUP>(TM)</SUP> can pass to a program is 255. The default value for <em>
|
|
number</em> is 250. The <strong>-n</strong> and
|
|
<strong>-L</strong> options are mutually exclusive. The last one
|
|
specified takes effect.</dd>
|
|
|
|
<dt><strong>-s</strong> <em>size</em></dt>
|
|
|
|
<dd>Set the maximum number of bytes for the command line length
|
|
provided to <em>utility</em>. The sum of the length of the utility
|
|
name and the arguments passed to <em>utility</em> (including NULL
|
|
terminators) will be less than or equal to <em>size</em>. The
|
|
default value for <em>size</em> is 16 252 928 bytes.</dd>
|
|
|
|
<dt><strong>-t</strong></dt>
|
|
|
|
<dd>Turn on trace mode. The command to be run is written to standard error
|
|
immediately before it is run.</dd>
|
|
|
|
<dt><strong>-x</strong></dt>
|
|
|
|
<dd>Force <strong>xargs</strong> to end immediately if a command
|
|
line containing <em>number</em> arguments will not fit in the
|
|
specified (or default) command line length.</dd>
|
|
</dl>
|
|
|
|
<p><strong>Exit Status</strong></p>
|
|
|
|
<ul>
|
|
<li>0 when all invocations of <em>utility</em> returned exit status 0.</li>
|
|
|
|
<li>1-125 when at least one invocation of <em>utility</em> returned a
|
|
non-zero exit status or there was an error.</li>
|
|
|
|
<li>126 when <em>utility</em> was found but could not be invoked.</li>
|
|
|
|
<li>127 when <em>utility</em> cannot be found.</li>
|
|
|
|
<li>>128 when <em>utility</em> was ended by a signal. The value is 128 plus the signal number.</li>
|
|
</ul>
|
|
|
|
<p><strong>Related information</strong></p>
|
|
|
|
<ul>
|
|
<li><a href="echo.htm">echo - Write arguments to standard
|
|
output</a></li>
|
|
|
|
<li><a href="eval.htm">eval - Construct command by concatenating
|
|
arguments</a></li>
|
|
|
|
<li><a href="find.htm">find - Find files</a></li>
|
|
</ul>
|
|
<!-- end ibmbody========================================================= -->
|
|
</body>
|
|
</html>
|
|
|