public final class Xargs extends Object
NAME
xargs - build and execute command lines from standard input
SYNOPSIS
xargs | |
xargs <args> | |
xargs <delimiter> | |
xargs <maxLines> | |
xargs <maxArgs> | |
xargs <maxLines> <maxArgs> | |
xargs <delimiter> <maxLines> | |
xargs <delimiter> <maxArgs> | |
xargs <delimiter> <maxLines> <maxArgs> | |
xargs <delimiter> <eof> <maxLines> <maxArgs> | |
xargs [-zxrt] | |
xargs [-zxrt] <delimiter> | |
xargs [-zxrt] <maxLines> | |
xargs [-zxrt] <maxArgs> | |
xargs [-zxrt] <maxLines> <maxArgs> | |
xargs [-zxrt] <delimiter> <maxLines> | |
xargs [-zxrt] <delimiter> <maxArgs> | |
xargs [-zxrt] <delimiter> <maxLines> <maxArgs> | |
xargs [-zxrt] <delimiter> <eof> <maxLines> <maxArgs> |
See Xargs.Interface
for the corresponding command signature methods.
DESCRIPTION
The xargs utility reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes the command (default is /bin/echo) one or more times withany initial arguments followed by items read from standard input. Blank lines onthe standard input are ignored.
Because Unix filenames can contain blanks and newlines, this default behaviour is often problematic; filenames containing blanks and/or newlines are incorrectly processed by xargs. In these situations it is better to use the --null option, which prevents such problems. When using this option you will need to ensure that the program which produces the input for xargs also uses a null character as a separator. If that program is find for example, the --print0 option does this for you.If any invocation of the command exits with a status of 255, xargs will stop immediately without reading any further input. An error messageis issued on stderr when this happens.
Options
The following options are supported:
-z | --delimiter0 | Input items are terminated by a null character instead of by
whitespace, and the quotes and backslash are not special (every
character is taken literally). Disables the end of file string,
which is treated like any other argument. Useful when input items
might contain white space, quote marks, or backslashes. The find
--print0 option produces input suitable for this mode.
(This option is ignored if an explicit delimiter operand is specified). | |||
-x | --exactArgs | Terminate immediately if maxArgs is specified but the found
number of variable items is less than maxArgs .
(This option is ignored if no | |||
-r | --noRunIfEmpty | If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there is no input. | |||
-t | --verbose | Print the command line on the standard error output before executing it. |
OPERANDS
The following operands are supported:
<delimiter> | : | String | Input items are terminated by the specified characters. | ||
<eof> | : | String | If the end of file string occurs as a line of input, the rest of the input is ignored. | ||
<maxLines> | : | long | Use at most maxLines nonblank input lines per command invocation. | ||
<maxArgs> | : | int | Use at most maxArgs arguments per command invocation. | ||
<args> | : | String... | String arguments defining the options and operands for the command. Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--maxArgs" operand have to be prefixed with the operand name (e.g. "--maxLines" for a subsequent line count operand value). | ||
<options> | : | XargsOptions | The options defining command behavior. |
Modifier and Type | Class and Description |
---|---|
static interface |
Xargs.Interface<R>
Interface defining all method signatures for the "xargs" command.
|
Modifier and Type | Field and Description |
---|---|
static XargsFactory |
Factory
Singleton
factory instance for the "xargs" command. |
static String |
NAME
The "xargs" command name.
|
static XargsOptionSets |
Options
|
public static final String NAME
public static final XargsOptionSets Options
z
, x
, r
, t
.
-z | --delimiter0 | Input items are terminated by a null character instead of by
whitespace, and the quotes and backslash are not special (every
character is taken literally). Disables the end of file string,
which is treated like any other argument. Useful when input items
might contain white space, quote marks, or backslashes. The find
--print0 option produces input suitable for this mode.
(This option is ignored if an explicit delimiter operand is specified). | |||
-x | --exactArgs | Terminate immediately if maxArgs is specified but the found
number of variable items is less than maxArgs .
(This option is ignored if no | |||
-r | --noRunIfEmpty | If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there is no input. | |||
-t | --verbose | Print the command line on the standard error output before executing it. |
public static final XargsFactory Factory
factory
instance for the "xargs" command.Copyright © 2024. All rights reserved.