1
1
/* xargs -- build and execute command lines from standard input
2
Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
2
Copyright (C) 1990, 91, 92, 93, 94, 2000, 2003, 2005 Free Software Foundation, Inc.
4
4
This program is free software; you can redistribute it and/or modify
5
5
it under the terms of the GNU General Public License as published by
14
14
You should have received a copy of the GNU General Public License
15
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 9 Temple Place - Suite 330, Boston, MA 02111-1307,
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20
20
/* Written by Mike Rendell <michael@cs.mun.ca>
21
and David MacKenzie <djm@gnu.ai.mit.edu>. */
21
and David MacKenzie <djm@gnu.org>. */
23
#include <gnulib/config.h>
25
#undef PACKAGE_VERSION
26
#undef PACKAGE_TARNAME
30
23
#include <config.h>
132
118
#ifdef gettext_noop
133
119
# define N_(String) gettext_noop (String)
135
# define N_(String) (String)
121
/* See locate.c for explanation as to why not use (String) */
122
# define N_(String) String
125
#include "buildcmd.h"
138
128
/* Return nonzero if S is the EOF string. */
139
129
#define EOF_STR(s) (eof_str && *eof_str == *s && !strcmp (eof_str, s))
141
131
extern char **environ;
133
/* Do multibyte processing if multibyte characters are supported,
134
unless multibyte sequences are search safe. Multibyte sequences
135
are search safe if searching for a substring using the byte
136
comparison function 'strstr' gives no false positives. All 8-bit
137
encodings and the UTF-8 multibyte encoding are search safe, but
138
the EUC encodings are not.
139
BeOS uses the UTF-8 encoding exclusively, so it is search safe. */
141
# define MULTIBYTE_IS_SEARCH_SAFE 1
143
#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_SEARCH_SAFE)
149
/* Simulate mbrlen with mblen as best we can. */
150
# define mbstate_t int
151
# define mbrlen(s, n, ps) mblen (s, n)
143
155
/* Not char because of type promotion; NeXT gcc can't handle it. */
144
156
typedef int boolean;
159
173
/* The name this program was run with. */
160
174
char *program_name;
162
/* Buffer for reading arguments from stdin. */
176
static FILE *input_stream;
178
/* Buffer for reading arguments from input. */
163
179
static char *linebuf;
181
static int keep_stdin = 0;
165
183
/* Line number in stdin since the last command was executed. */
166
184
static int lineno = 0;
186
static struct buildcmd_state bc_state;
187
static struct buildcmd_control bc_ctl;
168
191
/* If nonzero, then instead of putting the args from stdin at
169
192
the end of the command argument list, they are each stuck into the
170
193
initial args, replacing each occurrence of the `replace_pat' in the
172
195
static char *replace_pat = NULL;
174
198
/* The length of `replace_pat'. */
175
199
static size_t rplen = 0;
177
202
/* If nonzero, when this string is read on stdin it is treated as
179
I don't like this - it should default to NULL. */
180
static char *eof_str = "_";
204
IEEE Std 1003.1, 2004 Edition allows this to be NULL.
205
In findutils releases up to and including 4.2.8, this was "_".
207
static char *eof_str = NULL;
182
210
/* If nonzero, the maximum number of nonblank lines from stdin to use
183
211
per command line. */
184
212
static long lines_per_exec = 0;
189
217
/* If true, exit if lines_per_exec or args_per_exec is exceeded. */
190
218
static boolean exit_if_size_exceeded = false;
192
219
/* The maximum number of characters that can be used per command line. */
193
220
static long arg_max;
195
221
/* Storage for elements of `cmd_argv'. */
196
222
static char *argbuf;
198
226
/* The list of args being built. */
199
227
static char **cmd_argv = NULL;
201
229
/* Number of elements allocated for `cmd_argv'. */
202
230
static int cmd_argv_alloc = 0;
204
234
/* Number of valid elements in `cmd_argv'. */
205
235
static int cmd_argc = 0;
207
236
/* Number of chars being used in `cmd_argv'. */
208
237
static int cmd_argv_chars = 0;
210
239
/* Number of initial arguments given on the command line. */
211
240
static int initial_argc = 0;
213
243
/* Number of chars in the initial args. */
214
static int initial_argv_chars = 0;
244
/* static int initial_argv_chars = 0; */
216
246
/* true when building up initial arguments in `cmd_argv'. */
217
247
static boolean initial_args = true;
237
267
static int child_error = 0;
239
269
/* If true, print each command on stderr before executing it. */
240
static boolean print_command = false;
270
static boolean print_command = false; /* Option -t */
242
272
/* If true, query the user before executing each command, and only
243
273
execute the command if the user responds affirmatively. */
246
276
static struct option const longopts[] =
248
278
{"null", no_argument, NULL, '0'},
279
{"arg-file", required_argument, NULL, 'a'},
249
280
{"eof", optional_argument, NULL, 'e'},
250
{"replace", optional_argument, NULL, 'i'},
281
{"replace", optional_argument, NULL, 'I'},
251
282
{"max-lines", optional_argument, NULL, 'l'},
252
283
{"max-args", required_argument, NULL, 'n'},
253
284
{"interactive", no_argument, NULL, 'p'},
254
285
{"no-run-if-empty", no_argument, NULL, 'r'},
255
286
{"max-chars", required_argument, NULL, 's'},
256
287
{"verbose", no_argument, NULL, 't'},
288
{"show-limits", no_argument, NULL, 'S'},
257
289
{"exit", no_argument, NULL, 'x'},
258
290
{"max-procs", required_argument, NULL, 'P'},
259
291
{"version", no_argument, NULL, 'v'},
264
296
static int read_line PARAMS ((void));
265
297
static int read_string PARAMS ((void));
299
static char *mbstrstr PARAMS ((const char *haystack, const char *needle));
266
300
static void do_insert PARAMS ((char *arg, size_t arglen, size_t lblen));
267
301
static void push_arg PARAMS ((char *arg, size_t len));
268
303
static boolean print_args PARAMS ((boolean ask));
269
static void do_exec PARAMS ((void));
304
/* static void do_exec PARAMS ((void)); */
305
static int xargs_do_exec (const struct buildcmd_control *cl, struct buildcmd_state *state);
306
static void exec_if_possible PARAMS ((void));
270
307
static void add_proc PARAMS ((pid_t pid));
271
308
static void wait_for_proc PARAMS ((boolean all));
272
static long parse_num PARAMS ((char *str, int option, long min, long max));
309
static void wait_for_proc_all PARAMS ((void));
310
static long parse_num PARAMS ((char *str, int option, long min, long max, int fatal));
273
311
static long env_size PARAMS ((char **envp));
274
static void usage PARAMS ((FILE * stream, int status));
312
static void usage PARAMS ((FILE * stream));
321
val = sysconf(_SC_LINE_MAX);
329
/* either _SC_LINE_MAX was not available or
330
* there is no particular limit.
339
return 2048L; /* a reasonable guess. */
277
344
main (int argc, char **argv)
347
int show_limits = 0; /* --show-limits */
280
348
int always_run_command = 1;
349
char *input_file = "-"; /* "-" is stdin */
350
long posix_arg_size_max;
351
long posix_arg_size_min;
353
long size_of_environment = env_size(environ);
282
354
char *default_cmd = "/bin/echo";
283
355
int (*read_args) PARAMS ((void)) = read_line;
290
362
bindtextdomain (PACKAGE, LOCALEDIR);
291
363
textdomain (PACKAGE);
293
orig_arg_max = ARG_MAX;
294
if (orig_arg_max == -1)
295
orig_arg_max = LONG_MAX;
296
orig_arg_max -= 2048; /* POSIX.2 requires subtracting 2048. */
297
arg_max = orig_arg_max;
299
/* Sanity check for systems with huge ARG_MAX defines (e.g., Suns which
300
have it at 1 meg). Things will work fine with a large ARG_MAX but it
301
will probably hurt the system more than it needs to; an array of this
302
size is allocated. */
303
if (arg_max > 20 * 1024)
364
atexit (close_stdout);
365
atexit (wait_for_proc_all);
367
/* IEE Std 1003.1, 2003 specifies that the combined argument and
368
* environment list shall not exceed {ARG_MAX}-2048 bytes. It also
369
* specifies that it shall be at least LINE_MAX.
371
posix_arg_size_min = get_line_max();
372
posix_arg_size_max = bc_get_arg_max();
373
posix_arg_size_max -= 2048; /* POSIX.2 requires subtracting 2048. */
375
bc_init_controlinfo(&bc_ctl);
376
assert(bc_ctl.arg_max == posix_arg_size_max);
378
bc_ctl.exec_callback = xargs_do_exec;
381
/* Start with a reasonable default size, though this can be
382
* adjusted via the -s option.
384
arg_size = (128 * 1024) + size_of_environment;
306
386
/* Take the size of the environment into account. */
307
arg_max -= env_size (environ);
309
error (1, 0, _("environment is too large for exec"));
311
while ((optc = getopt_long (argc, argv, "+0e::i::l::n:prs:txP:",
387
if (size_of_environment > posix_arg_size_max)
389
error (1, 0, _("environment is too large for exec"));
393
bc_ctl.arg_max = posix_arg_size_max - size_of_environment;
396
/* Check against the upper and lower limits. */
397
if (arg_size > bc_ctl.arg_max)
398
arg_size = bc_ctl.arg_max;
399
if (arg_size < posix_arg_size_min)
400
arg_size = posix_arg_size_min;
405
while ((optc = getopt_long (argc, argv, "+0a:E:e::i::I:l::L:n:prs:txP:",
312
406
longopts, (int *) 0)) != -1)
317
411
read_args = read_string;
414
case 'E': /* POSIX */
415
case 'e': /* deprecated */
416
if (optarg && (strlen(optarg) > 0))
322
417
eof_str = optarg;
426
case 'I': /* POSIX */
427
case 'i': /* deprecated */
332
replace_pat = optarg;
429
bc_ctl.replace_pat = optarg;
431
bc_ctl.replace_pat = "{}";
335
432
/* -i excludes -n -l. */
433
bc_ctl.args_per_exec = 0;
434
bc_ctl.lines_per_exec = 0;
437
case 'L': /* POSIX */
438
case 'l': /* deprecated */
342
lines_per_exec = parse_num (optarg, 'l', 1L, -1L);
440
bc_ctl.lines_per_exec = parse_num (optarg, 'l', 1L, -1L, 1);
442
bc_ctl.lines_per_exec = 1;
345
443
/* -l excludes -i -n. */
444
bc_ctl.args_per_exec = 0;
445
bc_ctl.replace_pat = NULL;
351
args_per_exec = parse_num (optarg, 'n', 1L, -1L);
449
bc_ctl.args_per_exec = parse_num (optarg, 'n', 1L, -1L, 1);
352
450
/* -n excludes -i -l. */
451
bc_ctl.lines_per_exec = 0;
452
if (bc_ctl.args_per_exec == 1 && bc_ctl.replace_pat)
453
/* ignore -n1 in '-i -n1' */
454
bc_ctl.args_per_exec = 0;
456
bc_ctl.replace_pat = NULL;
459
/* The POSIX standard specifies that it is not an error
460
* for the -s option to specify a size that the implementation
461
* cannot support - in that case, the relevant limit is used.
358
arg_max = parse_num (optarg, 's', 1L, orig_arg_max);
464
arg_size = parse_num (optarg, 's', 1L, posix_arg_size_max, 0);
465
if (arg_size > posix_arg_size_max)
467
error (0, 0, "warning: value %ld for -s option is too large, using %ld instead", arg_size, posix_arg_size_max);
468
arg_size = posix_arg_size_max;
379
proc_max = parse_num (optarg, 'P', 0L, -1L);
494
proc_max = parse_num (optarg, 'P', 0L, -1L, 1);
383
502
printf (_("GNU xargs version %s\n"), version_string);
391
if (replace_pat || lines_per_exec)
392
exit_if_size_exceeded = true;
511
if (0 == strcmp (input_file, "-"))
513
input_stream = stdin;
517
keep_stdin = 1; /* see prep_child_for_exec() */
518
input_stream = fopen (input_file, "r");
519
if (NULL == input_stream)
522
_("Cannot open input file `%s'"),
527
if (bc_ctl.replace_pat || bc_ctl.lines_per_exec)
528
bc_ctl.exit_if_size_exceeded = true;
394
530
if (optind == argc)
398
534
argv = &default_cmd;
401
linebuf = (char *) xmalloc (arg_max + 1);
402
argbuf = (char *) xmalloc (arg_max + 1);
537
/* Taking into account the size of the environment,
538
* figure out how large a buffer we need to
539
* hold all the arguments. We cannot use ARG_MAX
540
* directly since that may be arbitrarily large.
541
* This is from a patch by Bob Prolux, <bob@proulx.com>.
543
if (bc_ctl.arg_max > arg_size)
548
_("Reducing arg_max (%ld) to arg_size (%ld)\n"),
549
bc_ctl.arg_max, arg_size);
551
bc_ctl.arg_max = arg_size;
557
_("Your environment variables take up %ld bytes\n"),
558
size_of_environment);
560
_("POSIX lower and upper limits on argument length: %ld, %ld\n"),
564
_("Maximum length of command we could actually use: %ld\n"),
565
(posix_arg_size_max - size_of_environment));
567
_("Size of command buffer we are actually using: %ld\n"),
571
linebuf = (char *) xmalloc (bc_ctl.arg_max + 1);
572
bc_state.argbuf = (char *) xmalloc (bc_ctl.arg_max + 1);
404
574
/* Make sure to listen for the kids. */
405
575
signal (SIGCHLD, SIG_DFL);
577
if (!bc_ctl.replace_pat)
409
579
for (; optind < argc; optind++)
410
push_arg (argv[optind], strlen (argv[optind]) + 1);
580
bc_push_arg (&bc_ctl, &bc_state,
581
argv[optind], strlen (argv[optind]) + 1,
411
584
initial_args = false;
412
initial_argc = cmd_argc;
413
initial_argv_chars = cmd_argv_chars;
585
bc_ctl.initial_argc = bc_state.cmd_argc;
586
bc_state.cmd_initial_argv_chars = bc_state.cmd_argv_chars;
415
588
while ((*read_args) () != -1)
416
if (lines_per_exec && lineno >= lines_per_exec)
589
if (bc_ctl.lines_per_exec && lineno >= bc_ctl.lines_per_exec)
591
xargs_do_exec (&bc_ctl, &bc_state);
422
595
/* SYSV xargs seems to do at least one exec, even if the
423
596
input is empty. */
424
if (cmd_argc != initial_argc
597
if (bc_state.cmd_argc != bc_ctl.initial_argc
425
598
|| (always_run_command && procs_executed == 0))
599
xargs_do_exec (&bc_ctl, &bc_state);
434
608
for (i = optind; i < argc; i++)
435
609
arglen[i] = strlen(argv[i]);
436
rplen = strlen (replace_pat);
610
bc_ctl.rplen = strlen (bc_ctl.replace_pat);
437
611
while ((len = (*read_args) ()) != -1)
439
613
/* Don't do insert on the command name. */
440
push_arg (argv[optind], arglen[optind] + 1);
614
bc_clear_args(&bc_ctl, &bc_state);
615
bc_state.cmd_argv_chars = 0; /* begin at start of buffer */
617
bc_push_arg (&bc_ctl, &bc_state,
618
argv[optind], arglen[optind] + 1,
622
initial_args = false;
442
624
for (i = optind + 1; i < argc; i++)
443
do_insert (argv[i], arglen[i], len);
448
wait_for_proc (true);
452
/* Read a line of arguments from stdin and add them to the list of
625
bc_do_insert (&bc_ctl, &bc_state,
630
xargs_do_exec (&bc_ctl, &bc_state);
639
append_char_to_buf(char **pbuf, char **pend, char **pp, int c)
641
char *end_of_buffer = *pend;
642
char *start_of_buffer = *pbuf;
644
if (p >= end_of_buffer)
646
if (bc_ctl.replace_pat)
648
size_t len = end_of_buffer - start_of_buffer;
649
size_t offset = p - start_of_buffer;
651
start_of_buffer = xrealloc(start_of_buffer, len*2);
652
if (NULL != start_of_buffer)
654
end_of_buffer = start_of_buffer + len;
655
p = start_of_buffer + offset;
658
/* Update the caller's idea of where the buffer is. */
659
*pbuf = start_of_buffer;
660
*pend = end_of_buffer;
667
/* Failed to reallocate. */
673
/* I suspect that this can never happen now, because append_char_to_buf()
674
* should only be called when replace_pat is true.
676
error (1, 0, _("argument line too long"));
683
/* Enough space remains. */
692
/* Read a line of arguments from the input and add them to the list of
453
693
arguments to pass to the command. Ignore blank lines and initial blanks.
454
694
Single and double quotes and backslashes quote metacharacters and blanks
455
695
as they do in the shell.
488
728
len = p - linebuf;
489
/* FIXME we don't check for unterminated quotes here. */
732
error (1, 0, _("unmatched %s quote; by default quotes are special to xargs unless you use the -0 option"),
733
quotc == '"' ? _("double") : _("single"));
490
735
if (first && EOF_STR (linebuf))
493
push_arg (linebuf, len);
737
if (!bc_ctl.replace_pat)
738
bc_push_arg (&bc_ctl, &bc_state,
571
error (1, 0, _("argument line too long"));
831
error (1, 0, _("argument line too long"));
835
append_char_to_buf(&linebuf, &endbuf, &p, c);
576
/* Read a null-terminated string from stdin and add it to the list of
840
/* Read a null-terminated string from the input and add it to the list of
577
841
arguments to pass to the command.
578
842
Return -1 if eof (either physical or logical) is reached,
579
843
otherwise the length of the string read (including the null). */
608
875
lineno++; /* For -l. */
610
877
len = p - linebuf;
612
push_arg (linebuf, len);
878
if (!bc_ctl.replace_pat)
879
bc_push_arg (&bc_ctl, &bc_state,
616
error (1, 0, _("argument line too long"));
888
error (1, 0, _("argument line too long"));
621
/* Replace all instances of `replace_pat' in ARG with `linebuf',
622
and add the resulting string to the list of arguments for the command
624
ARGLEN is the length of ARG, not including the null.
625
LBLEN is the length of `linebuf', not including the null.
627
COMPAT: insertions on the SYSV version are limited to 255 chars per line,
628
and a max of 5 occurrences of replace_pat in the initial-arguments.
629
Those restrictions do not exist here. */
632
do_insert (char *arg, size_t arglen, size_t lblen)
634
/* Temporary copy of each arg with the replace pattern replaced by the
636
static char *insertbuf;
638
int bytes_left = arg_max - 1; /* Bytes left on the command line. */
641
insertbuf = (char *) xmalloc (arg_max + 1);
646
size_t len; /* Length in ARG before `replace_pat'. */
647
char *s = strstr (arg, replace_pat);
656
strncpy (p, arg, len);
674
error (1, 0, _("command too long"));
676
push_arg (insertbuf, p - insertbuf);
679
/* Add ARG to the end of the list of arguments `cmd_argv' to pass
681
LEN is the length of ARG, including the terminating null.
682
If this brings the list up to its maximum size, execute the command. */
685
push_arg (char *arg, size_t len)
689
if (cmd_argv_chars + len > arg_max)
691
if (initial_args || cmd_argc == initial_argc)
692
error (1, 0, _("can not fit single argument within argument list size limit"));
694
|| (exit_if_size_exceeded &&
695
(lines_per_exec || args_per_exec)))
696
error (1, 0, _("argument list too long"));
699
if (!initial_args && args_per_exec &&
700
cmd_argc - initial_argc == args_per_exec)
704
if (cmd_argc >= cmd_argv_alloc)
709
cmd_argv = (char **) xmalloc (sizeof (char *) * cmd_argv_alloc);
714
cmd_argv = (char **) xrealloc (cmd_argv,
715
sizeof (char *) * cmd_argv_alloc);
720
cmd_argv[cmd_argc++] = NULL;
723
cmd_argv[cmd_argc++] = argbuf + cmd_argv_chars;
724
strcpy (argbuf + cmd_argv_chars, arg);
725
cmd_argv_chars += len;
729
894
/* Print the arguments of the command to execute.
730
895
If ASK is nonzero, prompt the user for a response, and
731
896
if the user responds affirmatively, return true;
932
/* Close stdin and attach /dev/null to it.
933
* This resolves Savannah bug #3992.
936
prep_child_for_exec (void)
940
const char inputfile[] = "/dev/null";
941
/* fprintf(stderr, "attaching stdin to /dev/null\n"); */
944
if (open(inputfile, O_RDONLY) < 0)
946
/* This is not entirely fatal, since
947
* executing the child with a closed
948
* stdin is almost as good as executing it
949
* with its stdin attached to /dev/null.
951
error (0, errno, "%s", inputfile);
766
957
/* Execute the command that has been built in `cmd_argv'. This may involve
767
958
waiting for processes that were previously executed. */
961
xargs_do_exec (const struct buildcmd_control *ctl, struct buildcmd_state *state)
774
push_arg ((char *) NULL, 0); /* Null terminate the arg list. */
965
bc_push_arg (&bc_ctl, &bc_state,
968
false); /* Null terminate the arg list. */
775
970
if (!query_before_executing || print_args (true))
777
972
if (proc_max && procs_executing >= proc_max)
788
983
error (1, errno, _("cannot fork"));
790
985
case 0: /* Child. */
791
execvp (cmd_argv[0], cmd_argv);
792
error (0, errno, "%s", cmd_argv[0]);
986
prep_child_for_exec();
987
execvp (bc_state.cmd_argv[0], bc_state.cmd_argv);
988
error (0, errno, "%s", bc_state.cmd_argv[0]);
793
989
_exit (errno == ENOENT ? 127 : 126);
795
992
add_proc (child);
798
cmd_argc = initial_argc;
799
cmd_argv_chars = initial_argv_chars;
995
bc_clear_args(&bc_ctl, &bc_state);
996
return 1; /* Success */
999
/* Execute the command if possible. */
1002
exec_if_possible (void)
1004
if (bc_ctl.replace_pat || initial_args ||
1005
bc_state.cmd_argc == bc_ctl.initial_argc || bc_ctl.exit_if_size_exceeded)
1007
xargs_do_exec (&bc_ctl, &bc_state);
802
1010
/* Add the process with id PID to the list of processes that have
863
1071
if (WEXITSTATUS (status) == 126 || WEXITSTATUS (status) == 127)
864
1072
exit (WEXITSTATUS (status)); /* Can't find or run the command. */
865
1073
if (WEXITSTATUS (status) == 255)
866
error (124, 0, _("%s: exited with status 255; aborting"), cmd_argv[0]);
1074
error (124, 0, _("%s: exited with status 255; aborting"), bc_state.cmd_argv[0]);
867
1075
if (WIFSTOPPED (status))
868
error (125, 0, _("%s: stopped by signal %d"), cmd_argv[0], WSTOPSIG (status));
1076
error (125, 0, _("%s: stopped by signal %d"), bc_state.cmd_argv[0], WSTOPSIG (status));
869
1077
if (WIFSIGNALED (status))
870
error (125, 0, _("%s: terminated by signal %d"), cmd_argv[0], WTERMSIG (status));
1078
error (125, 0, _("%s: terminated by signal %d"), bc_state.cmd_argv[0], WTERMSIG (status));
871
1079
if (WEXITSTATUS (status) != 0)
872
1080
child_error = 123;
1087
/* Wait for all child processes to finish. */
1090
wait_for_proc_all (void)
1092
static boolean waiting = false;
1098
wait_for_proc (true);
879
1102
/* Return the value of the number represented in STR.
880
1103
OPTION is the command line option to which STR is the argument.
881
1104
If the value does not fall within the boundaries MIN and MAX,
882
Print an error message mentioning OPTION and exit. */
1105
Print an error message mentioning OPTION. If FATAL is true,
885
parse_num (char *str, int option, long int min, long int max)
1109
parse_num (char *str, int option, long int min, long int max, int fatal)
893
1117
fprintf (stderr, _("%s: invalid number for -%c option\n"),
894
1118
program_name, option);
897
1122
else if (val < min)
899
fprintf (stderr, _("%s: value for -%c option must be >= %ld\n"),
1124
fprintf (stderr, _("%s: value for -%c option should be >= %ld\n"),
900
1125
program_name, option, min);
903
1136
else if (max >= 0 && val > max)
905
fprintf (stderr, _("%s: value for -%c option must be < %ld\n"),
1138
fprintf (stderr, _("%s: value for -%c option should be < %ld\n"),
906
1139
program_name, option, max);
926
usage (FILE *stream, int status)
1167
usage (FILE *stream)
928
1169
fprintf (stream, _("\
929
1170
Usage: %s [-0prtx] [-e[eof-str]] [-i[replace-str]] [-l[max-lines]]\n\
930
1171
[-n max-args] [-s max-chars] [-P max-procs] [--null] [--eof[=eof-str]]\n\
931
1172
[--replace[=replace-str]] [--max-lines[=max-lines]] [--interactive]\n\
932
1173
[--max-chars=max-chars] [--verbose] [--exit] [--max-procs=max-procs]\n\
933
[--max-args=max-args] [--no-run-if-empty] [--version] [--help]\n\
934
[command [initial-arguments]]\n"),
1174
[--max-args=max-args] [--no-run-if-empty] [--arg-file=file]\n\
1175
[--version] [--help] [command [initial-arguments]]\n"),
936
fputs (_("\nReport bugs to <bug-findutils@gnu.org>."), stream);
1177
fputs (_("\nReport bugs to <bug-findutils@gnu.org>.\n"), stream);