xref: /original-bsd/usr.bin/xargs/xargs.1 (revision 95a66346)
Copyright (c) 1990 The Regents of the University of California.
All rights reserved.

This code is derived from software contributed to Berkeley by
John B. Roll Jr.

%sccs.include.redist.man%

@(#)xargs.1 5.2 (Berkeley) 03/05/91

XARGS 1 ""
C 7
NAME
xargs - construct argument list(s) and execute utility.
SYNOPSIS
xargs [-t] [-f] [-n number] [-s size] [utility [argument ...]]
DESCRIPTION
The xargs utility reads space, tab, and newline delimited arguments from the standard input and executes the specified utility with them as arguments. Any arguments specified on the command line are given to the utility upon each invocation, followed by some number of the arguments read from standard input. The utility is repeatedly executed until standard input is exhausted.

Spaces and tabs may be embedded in arguments using single (`` ' '') or double (``"'') quotes or backslashes (``\e''). Single or double quotes escape all characters to the next matching quote character, backslashes escape the next character. Newlines may not be escaped.

The following options are available:

-n number Set the maximum number of arguments used from standard input for each invocation of the utility. An invocation of utility will use less than number standard input arguments if the number of bytes accumulated (see the -s option) exceeds the specified size or the last invocation of utility has fewer than number arguments remaining. The default value for number is 255.

-s size Set the maximum number of bytes to which the last component of the utility name, the command-line arguments, and the arguments read in from standard input may sum. The default value for size is 2048.

-t Echo the command to be executed to standard error immediately before it is executed.

-f Force xargs to ignore the exit status returned by utility . Normally a nonzero exit status will cause xargs to exit with status 1.

If no utility is specified, echo (1) is used.

Utility should never read from the standard input.

Xargs exits with 0 if no error occurred, and 1 otherwise.

"SEE ALSO"
echo(1)
STANDARDS
The xargs utility is expected to be POSIX 1003.2 compliant.