2015-01-30 20:51:23 +00:00
|
|
|
.Dd January 30, 2015
|
2015-01-31 13:20:02 +00:00
|
|
|
.Dt XARGS 1
|
2015-01-31 19:37:03 +00:00
|
|
|
.Os sbase
|
2015-01-30 20:51:23 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm xargs
|
2015-02-01 20:28:17 +00:00
|
|
|
.Nd construct argument list(s) and execute command
|
2015-01-30 20:51:23 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl n Ar maxargs
|
|
|
|
.Op Fl r
|
|
|
|
.Op Fl E Ar eofstr
|
|
|
|
.Op Ar cmd Op Ar arg...
|
|
|
|
.Sh DESCRIPTION
|
2015-02-01 19:52:28 +00:00
|
|
|
.Nm
|
|
|
|
reads space, tab, newline and EOF delimited strings from stdin
|
|
|
|
and executes the specified
|
|
|
|
.Ar cmd
|
|
|
|
with the strings as
|
|
|
|
.Ar arguments .
|
2015-01-30 20:51:23 +00:00
|
|
|
.Pp
|
2014-01-03 11:52:47 +00:00
|
|
|
Any arguments specified on the command line are given to the command upon
|
|
|
|
each invocation, followed by some number of the arguments read from
|
2015-02-01 19:52:28 +00:00
|
|
|
stdin. The command is repeatedly executed one or more times until stdin
|
2014-01-03 11:52:47 +00:00
|
|
|
is exhausted.
|
2015-01-30 20:51:23 +00:00
|
|
|
.Pp
|
2014-01-03 11:52:47 +00:00
|
|
|
Spaces, tabs and newlines may be embedded in arguments using single (`'')
|
2015-02-06 14:43:46 +00:00
|
|
|
or double (`"') quotes or backslashes ('\\'). Single quotes escape all
|
2014-01-03 11:52:47 +00:00
|
|
|
non-single quote characters, excluding newlines, up to the matching single
|
2015-02-06 14:43:46 +00:00
|
|
|
quote. Double quotes escape all non-double quote characters, excluding
|
|
|
|
newlines, up to the matching double quote. Any single character, including
|
2014-01-03 11:52:47 +00:00
|
|
|
newlines, may be escaped by a backslash.
|
2015-01-30 20:51:23 +00:00
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl n Ar maxargs
|
2015-02-01 19:52:28 +00:00
|
|
|
Use at most
|
|
|
|
.Ar maxargs
|
|
|
|
arguments per command line.
|
2015-01-30 20:51:23 +00:00
|
|
|
.It Fl r
|
2015-02-06 14:43:46 +00:00
|
|
|
Do not run the command if there are no arguments. Normally the command is
|
2014-01-03 11:52:47 +00:00
|
|
|
executed at least once even if there are no arguments.
|
2015-01-30 20:51:23 +00:00
|
|
|
.It Fl E Ar eofstr
|
2015-02-01 19:52:28 +00:00
|
|
|
Use
|
|
|
|
.Ar eofstr
|
|
|
|
as a logical EOF marker.
|
2015-01-30 20:51:23 +00:00
|
|
|
.El
|
|
|
|
.Sh EXIT STATUS
|
2014-01-07 11:37:24 +00:00
|
|
|
xargs exits with one of the following values:
|
2015-01-30 20:51:23 +00:00
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It 0
|
|
|
|
All invocations of command returned a zero exit status.
|
|
|
|
.It 123
|
|
|
|
One or more invocations of command returned a nonzero exit status.
|
|
|
|
.It 124
|
|
|
|
The command exited with a 255 exit status.
|
|
|
|
.It 125
|
|
|
|
The command was killed or stopped by a signal.
|
|
|
|
.It 126
|
|
|
|
The command was found but could not be executed.
|
|
|
|
.It 127
|
|
|
|
The command could not be found.
|
|
|
|
.It 1
|
|
|
|
Some other error occurred.
|
|
|
|
.El
|