22921a859f
Fix "new sentence, new line" warnings throughout so that formatters can produce correct spacing between sentences. join.1 Remove unnecessary Ns macros. These are not necessary for delimeters, which get special treatment. xinstall.1 Fix date in manual. The contents were last modified on 2016-12-03, so use that instead of the invalid date. grep.1 Fix escape sequence for `\<` and `\>`. ed.1 Remove spurious `\\n` escape for the null-command.
98 lines
2.1 KiB
Groff
98 lines
2.1 KiB
Groff
.Dd 2015-10-08
|
|
.Dt XARGS 1
|
|
.Os sbase
|
|
.Sh NAME
|
|
.Nm xargs
|
|
.Nd construct argument lists and execute command
|
|
.Sh SYNOPSIS
|
|
.Nm
|
|
.Op Fl rtx
|
|
.Op Fl E Ar eofstr
|
|
.Op Fl n Ar num
|
|
.Op Fl s Ar num
|
|
.Op Ar cmd Op Ar arg ...
|
|
.Sh DESCRIPTION
|
|
.Nm
|
|
reads space, tab, newline and EOF delimited strings from stdin
|
|
and executes the specified
|
|
.Ar cmd
|
|
with the strings as
|
|
.Ar arguments .
|
|
.Pp
|
|
Any arguments specified on the command line are given to the command upon
|
|
each invocation, followed by some number of the arguments read from
|
|
stdin.
|
|
The command is repeatedly executed one or more times until stdin is exhausted.
|
|
.Pp
|
|
Spaces, tabs and newlines may be embedded in arguments using single (`'')
|
|
or double (`"') quotes or backslashes ('\\').
|
|
Single quotes escape all non-single quote characters, excluding newlines, up
|
|
to the matching single quote.
|
|
Double quotes escape all non-double quote characters, excluding newlines, up
|
|
to the matching double quote.
|
|
Any single character, including newlines, may be escaped by a backslash.
|
|
.Sh OPTIONS
|
|
.Bl -tag -width Ds
|
|
.It Fl n Ar num
|
|
Use at most
|
|
.Ar num
|
|
arguments per command line.
|
|
.It Fl r
|
|
Do not run the command if there are no arguments.
|
|
Normally the command is executed at least once even if there are no arguments.
|
|
.It Fl E Ar eofstr
|
|
Use
|
|
.Ar eofstr
|
|
as a logical EOF marker.
|
|
.It Fl s Ar num
|
|
Use at most
|
|
.Ar num
|
|
bytes per command line.
|
|
.It Fl t
|
|
Write the command line to stderr before executing it.
|
|
.It Fl x
|
|
Terminate if the command line exceeds the system limit or the number of bytes
|
|
given with the
|
|
.Op Fl s
|
|
flag.
|
|
.El
|
|
.Sh EXIT STATUS
|
|
.Nm
|
|
exits with one of the following values:
|
|
.Bl -tag -width Ds
|
|
.It 0
|
|
All invocations of
|
|
.Ar cmd
|
|
returned a zero exit status.
|
|
.It 123
|
|
One or more invocations of
|
|
.Ar cmd
|
|
returned a nonzero exit status.
|
|
.It 124
|
|
.Ar cmd
|
|
exited with a 255 exit status.
|
|
.It 125
|
|
.Ar cmd
|
|
was killed or stopped by a signal.
|
|
.It 126
|
|
.Ar cmd
|
|
was found but could not be executed.
|
|
.It 127
|
|
.Ar cmd
|
|
could not be found.
|
|
.It 1
|
|
Some other error occurred.
|
|
.El
|
|
.Sh STANDARDS
|
|
The
|
|
.Nm
|
|
utility is compliant with the
|
|
.St -p1003.1-2013
|
|
specification except from the
|
|
.Op Fl p
|
|
flag.
|
|
.Pp
|
|
The
|
|
.Op Fl r
|
|
flag is an extension to that specification.
|