Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

xargs(1) OSS Shell and Utilities Reference Manual
NAME
xargs - Constructs argument lists and runs commands
SYNOPSIS
xargs [-e eof_string][-i][replace_string] | [-I replace_string] | [-r][-l][number] |[-
L number] |[-n number][-ptx][-s size][command][argument ...]
The xargs command constructs a command line by combining a command string, containing
a command and its ags or arguments with additional arguments read from standard input.
FLAGS
-e eof_string
Sets the logical End-of-File string to eof_string. By default, there is no logical End-
of-File. The xargs command reads standard input until it encounters either an End-of-
File character or the logical EOF string.
-i[replace_string]
This ag is the same as -I. The default replace_string for -i is {}.
The -i, -I, and -r ags are mutually exclusive; the last one of these ags specied takes
effect.
-I replace_string
Takes an entire line as a single argument and inserts it in each instance of
replace_string found in the command string. A maximum of ve arguments in the
command string can each contain one or more instances of replace_string. The xargs
command discards spaces and tabs at the beginning of each line. The argument con-
structed cannot be larger than 255 bytes. This ag also turns on the -x ag.
The -i, -I, and -r ags are mutually exclusive; the last one of these ags specied takes
effect.
-l[number]
This ag is the same as -L. The default number is 1. This ag turns on the -x ag.
The -l, -L, and -n ags are mutually exclusive; the last one of these ags specied
takes effect.
-L number
Runs the command string with the specied number of nonempty argument lines read
from standard input. The last invocation of the command string can have fewer argu-
ment lines if fewer than number remain. A line ends with the rst newline character
unless the last character of the line is a space or a tab. A trailing space or tab indicates
a continuation through the next nonempty line.
The -l, -L, and -n ags are mutually exclusive; the last one of these ags specied
takes effect.
-n number
Executes the command string using as many standard input arguments as possible, up
to a maximum of number (a positive decimal integer). The xargs command uses fewer
arguments if their total length is greater than the number of characters specied by the
-s size ag (or LINE_MAX if there is no -s ag). It also uses fewer arguments for the
last invocation if fewer than number arguments remain. When -x is present, each
number argument must t the length limitation specied by -s. When the replacement
string {} is in effect for the -i ag (the deafult), the maximum number of input argu-
ments that can be substituted is 1. Therefore, the use of the -n ag in this case has no
effect.
1032 Hewlett-Packard Company 527188-003