Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (v - z) xargs(1)
The -l, -L, and -n ags are mutually exclusive; the last one of these ags specied
takes effect.
-p Asks whether or not to run the command string. Trace mode (-t) is turned on to write
the command instance to be executed, followed by a prompt to standard error (?...).
An afrmative response read from /dev/tty executes the command. Any other response
causes xargs to skip that particular invocation of the command string. You are asked
about each invocation.
-r This ag is the same as -I {}.
The -i, -I, and -r ags are mutually exclusive; the last one of these ags specied takes
effect.
-s size Invokes the specied command using as many standard input arguments as possible,
yielding a command line length less than size (a positive decimal integer) bytes. Fewer
arguments are used if any of the following conditions is true:
The total number of arguments exceeds that specied by -n.
The total number of lines exceeds that specied by -L.
End-of-File is encountered on standard input before size bytes are accumu-
lated.
Note that the character count for size includes one extra character for each argument
and the number of characters in the command name. Values of size up to at least
LINE_MAX bytes are supported.
-t Echoes the command string and each constructed argument list to le descriptor 2 (usu-
ally standard error).
-x Stops running xargs if any argument list is greater than the number of characters
specied by the -s size ag. This ag is turned on if you specify either the -I or -L
ags. If you do not specify -I, -L,or-n, the total length of all arguments must be
within the length limit.
DESCRIPTION
The xargs command runs the command string as many times as necessary to process all input
arguments. The default command string is /usr/bin/echo.
Arguments read from standard input are character strings delimited by one or more spaces, tabs,
or newline characters. You can embed a space or a tab in arguments by preceding it with a \
(backslash) or by quoting it. The xargs command reads characters enclosed in single or double
quotes as literals and removes the delimiting quotes. It always discards empty lines.
The xargs command ends if it cannot run the command string or if it receives an exit code of
255. When the command string calls a shell procedure, the shell procedure should explicitly exit
with an appropriate value to avoid accidentally returning 255. (See the sh command.)
The LC_MESSAGES variables determines the locales equivalent of y and n (for yes/no
queries).
EXAMPLES
1. To use a command on les whose names are listed in a le, use a command line similar
to the following:
xargs ls -l < cles
If cles contains the text, enter:
527188-007 Hewlett-Packard Company 1033