The xargs utility shall conform to the Base Definitions volume of
POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.
The following options shall be supported:
-E
eofstr Use eofstr as the logical end-of-file string. If -E
is
not specified, it is unspecified whether the logical
end-of-file string is the <underscore> character ('_'
)
or the end-of-file string capability is disabled. When
eofstr is the null string, the logical end-of-file
string capability shall be disabled and <underscore>
characters shall be taken literally.
-I
replstr
Insert mode: utility is executed for each logical line
from standard input. Arguments in the standard input
shall be separated only by unescaped <newline>
characters, not by <blank> characters. Any unquoted
unescaped <blank> characters at the beginning of each
line shall be ignored. The resulting argument shall be
inserted in arguments in place of each occurrence of
replstr. At least five arguments in arguments can each
contain one or more instances of replstr. Each of
these constructed arguments cannot grow larger than an
implementation-defined limit greater than or equal to
255 bytes. Option -x
shall be forced on.
-L
number The utility shall be executed for each non-empty number
lines of arguments from standard input. The last
invocation of utility shall be with fewer lines of
arguments if fewer than number remain. A line is
considered to end with the first <newline> unless the
last character of the line is an unescaped <blank>; a
trailing unescaped <blank> signals continuation to the
next non-empty line, inclusive.
-n
number Invoke utility using as many standard input arguments
as possible, up to number (a positive decimal integer)
arguments maximum. Fewer arguments shall be used if:
* The command line length accumulated exceeds the
size specified by the -s
option (or {LINE_MAX} if
there is no -s
option).
* The last iteration has fewer than number, but not
zero, operands remaining.
-p
Prompt mode: the user is asked whether to execute
utility at each invocation. Trace mode (-t
) is turned
on to write the command instance to be executed,
followed by a prompt to standard error. An affirmative
response read from /dev/tty
shall execute the command;
otherwise, that particular invocation of utility shall
be skipped.
-s
size Invoke utility using as many standard input arguments
as possible yielding a command line length less than
size (a positive decimal integer) bytes. Fewer
arguments shall be used if:
* The total number of arguments exceeds that
specified by the -n
option.
* The total number of lines exceeds that specified by
the -L
option.
* End-of-file is encountered on standard input before
size bytes are accumulated.
Values of size up to at least {LINE_MAX} bytes shall be
supported, provided that the constraints specified in
the DESCRIPTION are met. It shall not be considered an
error if a value larger than that supported by the
implementation or exceeding the constraints specified
in the DESCRIPTION is given; xargs shall use the
largest value it supports within the constraints.
-t
Enable trace mode. Each generated command line shall be
written to standard error just prior to invocation.
-x
Terminate if a constructed command line will not fit in
the implied or specified size (see the -s
option
above).