]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/xargs/xargs.1
unfinished sblive driver, playback/mixer only for now - not enabled in
[FreeBSD/FreeBSD.git] / usr.bin / xargs / xargs.1
1 .\" Copyright (c) 1990, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" John B. Roll Jr. and the Institute of Electrical and Electronics
6 .\" Engineers, Inc.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\"    must display the following acknowledgement:
18 .\"     This product includes software developed by the University of
19 .\"     California, Berkeley and its contributors.
20 .\" 4. Neither the name of the University nor the names of its contributors
21 .\"    may be used to endorse or promote products derived from this software
22 .\"    without specific prior written permission.
23 .\"
24 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" SUCH DAMAGE.
35 .\"
36 .\"     @(#)xargs.1     8.1 (Berkeley) 6/6/93
37 .\" $FreeBSD$
38 .\"
39 .Dd June 6, 1993
40 .Dt XARGS 1
41 .Os
42 .Sh NAME
43 .Nm xargs
44 .Nd "construct argument list(s) and execute utility"
45 .Sh SYNOPSIS
46 .Nm xargs
47 .Op Fl 0
48 .Op Fl t
49 .Oo Op Fl x
50 .Fl n Ar number
51 .Oc
52 .Op Fl s Ar size
53 .Op Ar utility Op Ar arguments ...
54 .Sh DESCRIPTION
55 The
56 .Nm
57 utility reads space, tab, newline and end-of-file delimited arguments
58 from the standard input and executes the specified
59 .Ar utility
60 with them as
61 arguments.
62 .Pp
63 The utility and any arguments specified on the command line are given
64 to the
65 .Ar utility
66 upon each invocation, followed by some number of the arguments read
67 from standard input.
68 The
69 .Ar utility
70 is repeatedly executed until standard input is exhausted.
71 .Pp
72 Spaces, tabs and newlines may be embedded in arguments using single
73 (``\ '\ '')
74 .Ek
75 or double (``"'') quotes or backslashes (``\e'').
76 Single quotes escape all non-single quote characters, excluding newlines,
77 up to the matching single quote.
78 Double quotes escape all non-double quote characters, excluding newlines,
79 up to the matching double quote.
80 Any single character, including newlines, may be escaped by a backslash.
81 .Pp
82 The options are as follows:
83 .Bl -tag -width indent
84 .It Fl 0
85 Change
86 .Nm
87 to expect NUL
88 (``\\0'')
89 characters as separators, instead of spaces and newlines.
90 This is expected to be used in concert with the
91 .Fl print0
92 function in
93 .Xr find 1 .
94 .It Fl n Ar number
95 Set the maximum number of arguments taken from standard input for each
96 invocation of the utility.
97 An invocation of
98 .Ar utility
99 will use less than
100 .Ar number
101 standard input arguments if the number of bytes accumulated (see the
102 .Fl s
103 option) exceeds the specified
104 .Ar size
105 or there are fewer than
106 .Ar number
107 arguments remaining for the last invocation of
108 .Ar utility .
109 The current default value for
110 .Ar number
111 is 5000.
112 .It Fl s Ar size
113 Set the maximum number of bytes for the command line length provided to
114 .Ar utility .
115 The sum of the length of the utility name and the arguments passed to
116 .Ar utility
117 (including
118 .Dv NULL
119 terminators) will be less than or equal to this number.
120 The current default value for
121 .Ar size
122 is
123 .Dv ARG_MAX
124 - 2048.
125 .It Fl t
126 Echo the command to be executed to standard error immediately before it
127 is executed.
128 .It Fl x
129 Force
130 .Nm
131 to terminate immediately if a command line containing
132 .Ar number
133 arguments will not fit in the specified (or default) command line length.
134 .El
135 .Pp
136 If no
137 .Ar utility
138 is specified,
139 .Xr echo 1
140 is used.
141 .Pp
142 Undefined behavior may occur if
143 .Ar utility
144 reads from the standard input.
145 .Pp
146 The
147 .Nm
148 utility exits immediately (without processing any further input) if a
149 command line cannot be assembled,
150 .Ar utility
151 cannot be invoked, an invocation of the utility is terminated by a signal
152 or an invocation of the utility exits with a value of 255.
153 .Pp
154 The
155 .Nm
156 utility exits with a value of 0 if no error occurs.
157 If
158 .Ar utility
159 cannot be invoked,
160 .Nm
161 exits with a value of 127.
162 If any other error occurs,
163 .Nm
164 exits with a value of 1.
165 .Sh SEE ALSO
166 .Xr echo 1 ,
167 .Xr find 1
168 .Sh STANDARDS
169 The
170 .Nm
171 utility is expected to be
172 .St -p1003.2
173 compliant.