83 Commits

Author SHA1 Message Date
G. Branden Robinson
7e8712f0ca doc: use man(7) macros to style command synopses
* find/find.1:
* locate/locate.1:
* locate/updatedb.1:
* xargs/xargs.1: Favor man(7) font alternation macros over *roff font
  escape sequences.  When typesetting with groff(1), the macros
  automatically apply italic corrections.

* locate/locate.1: Protect long option name literals from hyphenation.
  GNU troff, Heirloom Doctools troff, and mandoc all support use of the
  `\%` hyphenation control escape sequence at the _beginning_ of a word
  suppress its hyphenation.  Other troffs do not.  Indirect this
  application of the escape sequence through a string, interpolating
  nothing on formatters that don't advertise GNU compatibility via the
  `.g` register.  (This means that literals can hyphenate undesirably on
  DWB, Solaris, and Plan 9 troffs.)

Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html

Copyright-paperwork-exempt: Yes
2026-01-05 16:52:58 +01:00
G. Branden Robinson
ad7e34650a doc: delete blank lines from man page sources
* find/find.1:
* xargs/xargs.1: Replace blank lines with empty requests or paragraphing
  macro calls as seems to be intended.
* find/find.1: Delete blank lines preceding paragraphing or sectioning
  macros that serve only to put excess vertical space in the output.
* locate/locatedb.5: Replace blank lines with a dummy character
  producing a blank output line as _might_ be intended.

groff_man_style(7):
     ?  The empty request (.), which does nothing, vertically spaces the
        input file for readability by the document maintainer.  Do not
        put blank (empty) lines in a man page source document.  Some
        man(1) programs ?squeeze? multiple blank output lines into one.

Fixes style warnings from `groff -rCHECKSTYLE=3 -man`:
an.tmac:/.../share/man/man1/find.1:87: style: blank line in input
...
an.tmac:/.../share/man/man1/xargs.1:231: style: blank line in input
...
an.tmac:/.../share/man/man5/locatedb.5:118: style: blank line in input
...

Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html

Copyright-paperwork-exempt: Yes
2026-01-05 16:52:37 +01:00
G. Branden Robinson
627072f022 doc: populate man pages' headers and footers more
Style warnings from `groff -rCHECKSTYLE=3 -man`.
an.tmac:/.../share/man/man1/locate.1:1: style: .TH missing third argument; \
  consider document modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:/.../share/man/man1/locate.1:1: style: .TH missing fourth argument; \
  consider package/project name and version (e.g., "groff 1.23.0")
...and similar.

groff_man_style(7):
     .TH identifier section [footer‐middle [footer‐inside [header‐
     middle]]]
...
            By convention, footer‐middle is the date of the most recent
            modification to the man page source document, and footer‐
            inside is the name and version or release of the project
            providing it.

* find/find.1:
* locate/locate.1:
* locate/locatedb.5:
* locate/updatedb.1:
* xargs/xargs.1: Add appropriate third and fourth arguments to `TH` macro calls.

To determine the revision date to include in the page, I used the Git
"AuthorDate" of the last commit consituting anything but a "bump" to the
copyright notice.

Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html

Copyright-paperwork-exempt: Yes
2026-01-02 22:48:58 +01:00
Bernhard Voelker
733bb9a054 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2026-01-02 11:46:15 +01:00
Bernhard Voelker
deb3f7066d maint: use consistent references to standard files in messages
Use standard input instead of stdin, standard output instead of stdout,
and standard error instead of stderr in messages and documentation.
Inspired by coreutils commit:
https://cgit.git.sv.gnu.org/cgit/coreutils.git/commit/?id=c9a30d6781

* cfg.mk (sc_standard_outputs): Add syntax-check rule.
* doc/find.texi: Do the above.
* find/find.1: Likewise.
* locate/locate.1: Likewise.
* locate/locate.c: Likewise.
* xargs/xargs.1: Likewise.
* xargs/xargs.c: Likewise.
2025-11-15 19:39:43 +01:00
Bernhard Voelker
c41a617953 doc: clarify that POSIX Issue 8 is "IEEE Std 1003.1-2024"
* doc/find.texi: Do the above in various places.
* find/find.1:  Likewise.
* xargs/xargs.1: Likewise.
2025-11-15 19:39:43 +01:00
Bernhard Voelker
f1f6471ae8 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2025-01-04 11:43:53 +01:00
James Youngman
76ddbb913e doc: State that find -print0 and xargs -0 are in POSIX from Issue 8.
The forthcoming Issue 8 of the POSIX standard includes find -print0
and xargs -0.
* doc/find.texi: find -print0 is no longer GNU-specific.  Similarly
for xargs -0.
* xargs/xargs.1: Likewise.
* NEWS: mention these changes.
2024-06-03 12:40:42 +01:00
James Youngman
9fed05088f [doc] Mention the changes to xargs -P
* doc/find.texi: explain how xargs -P affects the handling of the
SIGUSR1 and SIGUSR2 signals.
* xargs/xargs.1: Likewise.
2024-05-19 11:27:46 +01:00
James Youngman
ad636eae01 xargs: Wait for all children even if one exited with 255.
* xargs/xargs.c: fix Savannah bug #64451 (xargs -P exits before all
children have exited if one exits with status 255).
* xargs/xargs.1 (BUGS): mention this bug and the corrected behaviour.
* doc/find.texi: Likewise.
* NEWS: mention this bugfix.
2024-05-18 10:59:52 +01:00
Bernhard Voelker
ea1abfa968 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2024-01-02 09:13:29 +01:00
Bernhard Voelker
65f456e055 xargs.1: narrow down deprecation on the -i option
The long option --replace it not deprecated, only the short form.

* xargs/xargs.1: Clarify the above better by explicitly mentioning
the short -i form.
2023-10-14 18:29:20 +02:00
Bernhard Voelker
c2002a3646 xargs.1: further editing improvements
* xargs/xargs.1: Start new sentences on a new line.
Use '\~' as unbreakable space in "2048 bytes".
2023-09-24 16:11:06 +02:00
Bjarni Ingi Gislason
a77c161b65 xargs.1: some remarks and editing fixes in the man page
Not in the patch.

Output from "mandoc -T lint xargs.1":

mandoc: xargs.1:1:2: WARNING: missing date, using "": TH

#######

Change '-' (\-) to '\(en' (en-dash) for a numeric range.
GNU gnulib has recently (2023-06-18) updated its
"build_aux/update-copyright" to recognize "\(en" in man pages.

xargs.1:393:if any invocation of the command exited with status 1-125
xargs.1:518:Copyright \(co 1990-2023 Free Software Foundation, Inc.

#####

Change (or include a "FIXME" paragraph about) misused SI (metric)
numeric prefixes (or names) to the binary ones, like Ki (kibi), Mi
(mebi), Gi (gibi), or Ti (tebi), if indicated.
If the metric prefixes are correct, add the definitions or an
explanation to avoid misunderstanding.

254:more than 128KiB, 128Kib is used as the default value; otherwise, the
255:default value is the maximum.  1KiB is 1024 bytes.

#####

Reduce space between words.

51:prevents such problems.   When using this option you will need to
94:command.   Multibyte characters are not supported.
466:internally.   This means that there is an upper limit on the length
492:a line which is longer than it can handle.   This is not an ideal

#####

Change -- in x--y to \(em (em-dash), or, if an
option, to \-\-

268:.BR --no-run-if-empty )

#####

Change - to \- if it shall be printed as a minus sign.

xargs.1:393:if any invocation of the command exited with status 1-125
xargs.1:518:Copyright \(co 1990-2023 Free Software Foundation, Inc.

#####

Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front of a
name for an option.

234:.BR -t .
248:.BI -s " max-chars\fR, \fI" \-\-max\-chars "=\fImax-chars\fR"

#####

Wrong distance between sentences.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

51:prevents such problems.   When using this option you will need to
94:command.   Multibyte characters are not supported.
316:are mutually exclusive. If some of them are specified at the same
466:internally.   This means that there is an upper limit on the length
492:a line which is longer than it can handle.   This is not an ideal

#####

Do not use more than two space characters between sentences or (better)
only a new line character.

51:prevents such problems.   When using this option you will need to
94:command.   Multibyte characters are not supported.
466:internally.   This means that there is an upper limit on the length
492:a line which is longer than it can handle.   This is not an ideal

#####

  Not in the patch.

Output from "test-nroff -man -b -ww -z":

[ "test-groff" is a developmental version of "groff" ]

Input file is ./xargs.1

Output from test-groff -b -mandoc -dAD=l -rF0 -rHY=0 -t -w w -z :
an.tmac:/tmp/chk_manuals.temp.ZC2PK6:1: style: .TH missing third argument;\
  suggest document modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:/tmp/chk_manuals.temp.ZC2PK6:1: style: .TH missing fourth argument;\
  suggest package/project name and version (e.g., "groff 1.23.0")

####

* xargs/xargs.1: Change as described above.
2023-09-23 16:12:45 +02:00
Bernhard Voelker
6aedc4e631 doc: fix extra escaping of a minus '-' character in xargs.1
* xargs/xargs.1 (--show-limits): Remove redundant backslash character,
introduced when adding the description of that option in commit
956992ff71b3 in 2005.
2023-05-23 22:17:15 +02:00
Bernhard Voelker
bbd06d8e06 doc: document double dash "--" option delimiter for xargs
* doc/find.texi (node xargs options): Add description of the "--"
option delimiter.
* xargs/xargs.1 (OPTIONS): Likewise.
* NEWS (Documentation Changes): Document the change.

Suggested by Dan Jacobson <jidanni@jidanni.org> in
<https://lists.gnu.org/r/bug-findutils/2023-04/msg00009.html>
2023-05-23 22:17:07 +02:00
James Youngman
fc47dadea9 doc: describe history of find, xargs and locate. 2023-03-18 20:23:43 +00:00
Bernhard Voelker
7836aa1def doc: use "end-of-file" with hyphenation consistently
* cfg.mk (sc_prohibit_unhyphenated_eof): Add syntax-check rule.
* doc/find.texi: Change "end of file" to "end-of-file" in several places.
* xargs/xargs.1: Likewise.
* xargs/xargs.c (eof_str): Change comment to adhere to the new rule.
2023-02-13 20:46:48 +01:00
ribbon
6490a80765 doc: minor formatting fixes in xargs.1
* xargs/xargs.1 (--max-args): Reset the bold formatting earlier
in two places.

Fixes https://sv.gnu.org/bugs/?62325

Copyright-paperwork-exempt: Yes
2023-01-02 00:05:44 +01:00
Bernhard Voelker
73d020f472 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2023-01-01 23:51:15 +01:00
Bernhard Voelker
db5ec614a7 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
The format of the copyright year number range in Texinfo files is
"YEAR1--YEAR2" now, i.e., with 2x '-'.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2022-01-02 18:42:35 +01:00
Bernhard Voelker
b6783f8470 xargs.1: clarify 'echo' as the default command
The default command changed from '/bin/echo' to 'echo' in version 4.5.11,
but the commit 804ff7b90e only adjusted the Texinfo manual.

* xargs/xargs.1 (.SH DESCRIPTION): Change the default command here
in the man page as well.
2021-01-31 12:17:55 +01:00
Andreas Metzler
ee402bdd3a xargs: warn on conflicting options -L, -I, -n
* xargs/xargs.c (warn_mutually_exclusive): Add function to output the
new warning diagnostic.
(main): Call the above new function in order to show a warning message
if conflicting options (-L -l -I -i -n) are specified.
* xargs/xargs.1: Explicitly document the fact that -L -l -I -i -n
options are mutually exclusive and how xargs behaves when more than one
of these options are specified.
* doc/find.texi (node Conflicting xargs options): Likewise, add this
section with examples.
* xargs/testsuite/config/unix.exp (xargs_start): Replace the full path
of the xargs executable in the stderr output file by its basename.
* xargs/testsuite/xargs.gnu/P3-n1-IARG.xe: Add file containing the
expected output with the new warning diagnostic.
* xargs/testsuite/xargs.posix/L2-n2.xe: Likewise.
* xargs/testsuite/xargs.posix/rc-123.xe: Likewise.
* xargs/testsuite/xargs.sysv/l1n4.xe: Likewise.
* xargs/testsuite/xargs/testsuite/xargs.gnu/P3-n1-IARG.exp: Ensure the
error diagnostic is in C locale to avoid false positives in other locales.
* xargs/testsuite/xargs.posix/L2-n2.exp: Likewise.
* xargs/testsuite/xargs.posix/rc-123.exp: Likewise.
* xargs/testsuite/xargs.sysv/l1n4.exp: Likewise.
* tests/xargs/conflicting_opts.sh: Add test coverage for combinations
of the mutually exclusive options -I -L and -n.
* xargs/testsuite/Makefile.am (EXTRA_DIST_EXP): Reference the new tests.
(EXTRA_DIST_XO): Reference the new *.xo files.
(EXTRA_DIST_XE): Reference the new *.xe files.
* NEWS (Improvements): Mention the change.

Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>

Discussed at https://savannah.gnu.org/bugs/?52137
Duplicate of https://savannah.gnu.org/bugs/?58156
2021-01-07 18:28:00 +01:00
Bernhard Voelker
c5da48bcff maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
The format of the copyright year number range in Texinfo files is
"YEAR1--YEAR2" now, i.e., with 2x '-'.
* tests/sample-test: Likewise, here to avoid starting a year number range.
* All other files: Update copyright years via the above make run.
2021-01-02 01:46:51 +01:00
Bernhard Voelker
ab3bb081ba doc: harmonize the end of the man pages
The "BUGS" section also documented how to report bugs.  This is better
done in a separate "REPORTING BUGS" section.  Add this section where
missing.  In it, redirect the user to the "How to get help" section
("#get-help") of the GNU findutils online page; also mention where
to report translation issues.

Bring the sections "SEE ALSO" and "COPYRIGHT" into the correct order,
which is: "REPORTING BUGS", "COPYRIGHT" and finally "SEE ALSO".
See 'man-pages(7)'.

The "SEE ALSO" section now refers to both the corresponding node in
the online HTML version of the Texinfo manual and lists the 'info' command.
Sort the entries referring to other man pages: first by their manual
section numbers, then alphabetically.

While at it, add an empty line (directive '.') before all '.SH' section
headers.

* find/find.1: Do the above.
* locate/locate.1: Likewise.
* locate/locatedb.5: Likewise.
* locate/updatedb.1: Likewise.
* xargs/xargs.1: Likewise.
2020-12-30 19:11:18 +01:00
Bernhard Voelker
2ac3be4c99 xargs.1: remove deprecated .PD macro
Use of the .PD macro is discouraged, see:
https://man7.org/linux/man-pages/man7/groff_man_style.7.html

* xargs/xargs.1 (.SH OPTIONS): Remove all uses of the .PD macro.
2020-12-30 19:11:18 +01:00
Bernhard Voelker
83ca662d42 xargs.1: improve indentation of list of exit statuses
* xargs/xargs.1 (EXIT STATUS): Use .RS + .IP + .RE to get a nicer
indentation of the list of exit values.
2020-12-30 19:11:18 +01:00
Bjarni Ingi Gislason
de3c6279f2 doc: fix warnings from "mandoc -Tlint" in man pages
mandoc: ./find/find.1:313:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./find/find.1:607:1: WARNING: skipping paragraph macro: sp after PP
mandoc: ./find/find.1:606:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./find/find.1:1678:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./find/find.1:2063:2: STYLE: fill mode already enabled, skipping: fi
mandoc: ./find/find.1:2302:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./find/find.1:2400:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./find/find.1:2455:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./locate/locate.1:282:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./locate/locatedb.5:153:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./locate/updatedb.1:128:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./xargs/xargs.1:316:2: STYLE: fill mode already enabled, skipping: fi
mandoc: ./xargs/xargs.1:327:2: STYLE: fill mode already enabled, skipping: fi

* find/find.1: Remove superfluous paragraph macros.
Remove superfluous requests ".fi".
* locate/locate.1: Likewise.
* locate/locatedb.5: Likewise.
* locate/updatedb.1: Likewise.
* xargs/xargs.1: Likewise.
2020-06-22 21:28:02 +02:00
Kim Thor
44e995915f xargs.1: fix grammar issue
* xargs/xargs.1 (BUGS): Remove extra "the".
Fixes https://sv.gnu.org/bugs/?58193

Copyright-paperwork-exempt: Yes
2020-04-17 08:52:24 +02:00
Bernhard Voelker
f7ea96d2b8 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Likewise, here to avoid starting a year number range.
* All other files: Update copyright years via the above make run.
2020-01-01 16:22:52 +01:00
Bernhard Voelker
487d0701c5 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
2019-01-04 23:47:26 +01:00
Bernhard Voelker
8705455ce0 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
2018-01-01 19:27:15 +01:00
Bernhard Voelker
2cb10332af all: prefer https:// URLs where possible
Change from http:// to https:// URLs for the following:
www.gnu.org, gnu.org, savannah.gnu.org, git.sv.gnu.org, lists.gnu.org,
translationproject.org, cve.mitre.org, cwe.mitre.org, xkcd.com,
standards.ieee.org, and gcc.gnu.org.

* COPYING: Do the above replacement.
* ChangeLog-2013: Likewise.
* NEWS: Likewise.
* README: Likewise.
* README-hacking: Likewise.
* build-aux/Makefile.am: Likewise.
* build-aux/check-testfiles.sh: Likewise.
* build-aux/gen-changelog.sh: Likewise.
* build-aux/man-lint.sh: Likewise.
* build-aux/src-sniff.py: Likewise.
* cfg.mk: Likewise.
* configure.ac: Likewise.
* doc/Makefile.am: Likewise.
* doc/find-maint.texi: Likewise.
* doc/find.texi: Likewise.
* find/defs.h: Likewise.
* find/exec.c: Likewise.
* find/find.1: Likewise.
* find/finddata.c: Likewise.
* find/fstype.c: Likewise.
* find/ftsfind.c: Likewise.
* find/oldfind.c: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/print.c: Likewise.
* find/print.h: Likewise.
* find/sharefile.c: Likewise.
* find/sharefile.h: Likewise.
* find/testsuite/Makefile.am: Likewise.
* find/testsuite/binary_locations.sh: Likewise.
* find/testsuite/checklists.py: Likewise.
* find/testsuite/config/unix.exp: Likewise.
* find/testsuite/find.gnu/name-period.exp: Likewise.
* find/testsuite/find.posix/depth1.exp: Likewise.
* find/testsuite/sv-34079.sh: Likewise.
* find/testsuite/sv-34976-execdir-fd-leak.sh: Likewise.
* find/testsuite/sv-48030-exec-plus-bug.sh: Likewise.
* find/testsuite/sv-48180-refuse-noop.sh: Likewise.
* find/testsuite/sv-52220.sh: Likewise.
* find/testsuite/sv-bug-32043.sh: Likewise.
* find/testsuite/test_escape_c.sh: Likewise.
* find/testsuite/test_escapechars.sh: Likewise.
* find/testsuite/test_inode.sh: Likewise.
* find/testsuite/test_type-list.sh: Likewise.
* find/tree.c: Likewise.
* find/util.c: Likewise.
* gnulib-local/lib/gcc-function-attributes.h: Likewise.
* lib/bugreports.c: Likewise.
* lib/bugreports.h: Likewise.
* lib/buildcmd.c: Likewise.
* lib/buildcmd.h: Likewise.
* lib/check-regexprops.sh: Likewise.
* lib/dircallback.c: Likewise.
* lib/dircallback.h: Likewise.
* lib/extendbuf.c: Likewise.
* lib/extendbuf.h: Likewise.
* lib/fdleak.c: Likewise.
* lib/fdleak.h: Likewise.
* lib/findutils-version.c: Likewise.
* lib/findutils-version.h: Likewise.
* lib/listfile.c: Likewise.
* lib/listfile.h: Likewise.
* lib/printquoted.c: Likewise.
* lib/printquoted.h: Likewise.
* lib/qmark.c: Likewise.
* lib/regexprops.c: Likewise.
* lib/regextype.c: Likewise.
* lib/regextype.h: Likewise.
* lib/safe-atoi.c: Likewise.
* lib/safe-atoi.h: Likewise.
* lib/splitstring.c: Likewise.
* lib/splitstring.h: Likewise.
* lib/test_splitstring.c: Likewise.
* lib/unused-result.h: Likewise.
* locate/frcode.c: Likewise.
* locate/locate.1: Likewise.
* locate/locate.c: Likewise.
* locate/locatedb.5: Likewise.
* locate/locatedb.h: Likewise.
* locate/testsuite/Makefile.am: Likewise.
* locate/testsuite/config/unix.exp: Likewise.
* locate/updatedb.1: Likewise.
* locate/updatedb.sh: Likewise.
* locate/word_io.c: Likewise.
* po/fetch-po-files: Likewise.
* xargs/testsuite/Makefile.am: Likewise.
* xargs/testsuite/config/unix.exp: Likewise.
* xargs/xargs.1: Likewise.
* xargs/xargs.c: Likewise.
2017-10-23 00:57:57 +02:00
Bernhard Voelker
079eb4cdb6 doc: add copyright section to man pages
* find/find.1: Add copyright section, deriving first copyright year from
the corresponding *.c file.
* locate/locate.1: Likewise.
* locate/locatedb.5: Likewise.
* locate/updatedb.1: Likewise.
* xargs/xargs.1: Likewise.
2017-10-23 00:57:57 +02:00
Andreas Metzler
3e4bb112ae doc: drop workarounds for missing xargs -o option
* doc/find.texi (Multiple Files): Mention the new --open-tty option
to be used as an alternative.
(Safe File Name Handling): Likewise.
* xargs/xargs.1 (EXAMPLES): Remove the tty redirection example.
2017-06-09 00:44:42 +02:00
Bernhard Voelker
40cd25147b xargs: add -o, --open-tty option
This option is available in the xargs implementation of FreeBSD, NetBSD,
OpenBSD and in the Apple variant.  Add it for compatibility.

* xargs/xargs.c (open_tty): Add static flag for the new option.
(longopts): Add member.
(main): Handle the 'o' case in the getopt_long() loop.
(prep_child_for_exec): Redirect stdin of the child to /dev/tty when
the -o option is given.  Furthermore, move the just-opened file
descriptor to STDIN_FILENO.
(usage): Document the new option.
* bootstrap.conf (gnulib_modules): Add dup2.
* xargs/xargs.1 (SYNOPSIS): Replace the too-long list of options by
"[options]" - they are listed later anyway.
(OPTIONS): Document the new option.
(STANDARDS CONFORMANCE): Mention that the -o option is an extension.
* doc/find.texi (xargs options): Document the new option.
(Invoking the shell from xargs): Amend the explanation of the
redirection example with a note about the -o option.
(Viewing And Editing): Likewise.
(Error Messages From xargs): Add the message when dup2() fails.
(NEWS): Mention the new option.

Fixes http://savannah.gnu.org/bugs/?51151
2017-06-09 00:44:42 +02:00
Steve Dougherty
85e8c810a2 doc: fix spelling of "output"
* doc/find.texi (node Controlling Parallelism): s/ouptut/output/
* xargs/xargs.1: Likewise.
* find/util.c (cleanup): While at it, fix the same typo here
in a comment, too.

Copyright-paperwork-exempt: Yes
2016-05-18 08:05:58 +02:00
James Youngman
c7d66f8340 Don't overflow sig_atomic_t for --max-procs.
* xargs/xargs.c (__STDC_LIMIT_MACROS): Define __STDC_LIMIT_MACROS
in order to ensure that <stdint.h> defines the SIG_ATOMIC_MAX
macro, which we need.
(MAX_PROC_MAX): Define this as the maximum allowed value of
proc_max.
(main): Show the value of MAX_PROC_MAX for --show-limits.
(increment_proc_max): Don't increment proc_max beyond
MAX_PROC_MAX.
(parse_num): Fix small error in the error message; if the limit on
the value of a command-line argument is N, explain that the user
should specify a value <= N, not < N.
* xargs/xargs.1: Document the upper limit on --max-procs.
* doc/find.texi (Controlling Parallelism): Document the upper
limit on the amount of parallelism.
(xargs options): Document the limit on the value you can specify
for --max-procs.
2014-08-23 12:45:28 +01:00
James Youngman
3aad932d73 Fix bug #40094: minor inconsistencies in xargs option descriptions.
* xargs/xargs.1: Update the description of -e option to emphasize
that the argument must follow the option letter immediately (in
other words, that it may not appear in the next program argument).
Likewise for the the -i and -l (lower-case L) options.
* xargs/xargs.c (usage): Minor consistency improvements to help
text.
2013-09-24 23:02:00 +01:00
James Youngman
1ccfd46a25 Refer to the info manual in a clearer and more explicit way.
* find/find.1 (SEE ALSO): Explain how to invoke info to read the
Texinfo manual.
* locate/locate.1 (SEE ALSO): Likewise.
* locate/updatedb.1 (SEE ALSO): Likewise.
* xargs/xargs.1 (SEE ALSO): Likewise.
2013-09-20 17:56:29 +01:00
James Youngman
842a39c81b Expand on warning about xargs -P and stdout, including in Info.
* xargs/xargs.1: Expand on the warning about sharing stdout for
"xargs -P".
* doc/find.texi (Controlling Parallelism): Add a suitable warning
about sharing resources here, too.
* NEWS: Mention that all relevant documentation was updated with
this warning.
2013-03-24 23:14:06 +00:00
Bernhard Voelker
1611816e08 xargs: document need to manage access to resources with -P option
* xargs/xargs.1 (-P option): Add a note that it is the duty of the
called processes to access shared resources like stdout properly to
avoid undetermined results like mangled output.

Reported by Congshi Huang in http://sv.gnu.org/bugs/?38356.
2013-03-24 23:14:06 +00:00
James Youngman
efe9183443 Enable the sc_trailing_blank check.
* cfg.mk: Enable sc_trailing_blank check.
(exclude_file_name_regexp--sc_trailing_blank): Exclude
xargs test inputs and outputs.  Exclude the COPYING file.  Exclude
a find test output.  Exclude the .po files.
* xargs/xargs.c: Remove trailing blanks.
* xargs/testsuite/config/unix.exp: Likewise.
* find/testsuite/find.posix/bracket-depth.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions1.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions2.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions3.exp: Likewise.
* find/testsuite/find.posix/nameslash.exp: Likewise.
* find/testsuite/find.posix/perm-vanilla.exp: Likewise.
* find/testsuite/find.posix/sizes.exp: Likewise.
* find/testsuite/find.posix/sv-bug-25359.exp: Likewise.
* find/testsuite/find.posix/typesize.exp: Likewise.
* find/testsuite/find.gnu/access.exp: Likewise.
* find/testsuite/find.gnu/deletedir.exp: Likewise.
* find/testsuite/find.gnu/deletefile.exp: Likewise.
* find/testsuite/find.gnu/exec-one-rtn-fail.exp: Likewise.
* find/testsuite/find.gnu/execdir-hier.exp: Likewise.
* find/testsuite/find.gnu/execdir-pwd.exp: Likewise.
* find/testsuite/find.gnu/execdir-root-only.exp: Likewise.
* find/testsuite/find.gnu/follow-arg-parent-symlink.exp: Likewise.
* find/testsuite/find.gnu/ilname.exp: Likewise.
* find/testsuite/find.gnu/lname.exp: Likewise.
* find/testsuite/find.gnu/perm-slash.exp: Likewise.
* find/testsuite/find.gnu/posix-h.exp: Likewise.
* find/testsuite/find.gnu/sv-bug-17782.exp: Likewise.
* find/testsuite/find.gnu/sv-bug-24169.exp: Likewise.
* find/testsuite/find.gnu/used-invarg.exp: Likewise.
* find/testsuite/find.gnu/used-missing.exp: Likewise.
* find/testsuite/excuses.txt: Likewise.
* locate/testsuite/config/unix.exp: Likewise.
* locate/testsuite/locate.gnu/bigendian.exp: Likewise.
* locate/testsuite/locate.gnu/bigprefix1.exp: Likewise.
* locate/testsuite/locate.gnu/exists2.exp: Likewise.
* locate/testsuite/locate.gnu/exists3.exp: Likewise.
* locate/testsuite/locate.gnu/littleendian.exp: Likewise.
* locate/testsuite/locate.gnu/notexists2.exp: Likewise.
* locate/testsuite/locate.gnu/notexists3.exp: Likewise.
* locate/testsuite/locate.gnu/sv-bug-14535.exp: Likewise.
* xargs/testsuite/xargs.posix/arg_max_32bit_linux_bug.exp: Likewise.
* xargs/testsuite/xargs.posix/arg_max_64bit_linux_bug.exp: Likewise.
* xargs/testsuite/xargs.posix/rc-125.exp: Likewise.
* xargs/testsuite/xargs.posix/sv-bug-18714.exp: Likewise.
* xargs/testsuite/xargs.posix/sv-bug-18714b.exp: Likewise.
* po/Makevars (EXTRA_LOCALE_CATEGORIES): Likewise.
* xargs/xargs.1 (SEE ALSO): Likewise.
2011-06-12 03:21:47 +01:00
James Youngman
9e15f9cdcb #29698: Correct and clarify documentation of xargs -d option
* xargs/xargs.1: Update documentation for -d option to more
clearly distinguish the treatment of backslashes in the input and
the treatment of backslashes in the argument to -d.
* NEWS: Mention this bugfix.
2011-05-15 18:33:13 +01:00
James Youngman
6f7b74d052 Implement xargs --process-slot-var.
* xargs/xargs.c (set_slot_var): New function; sets an environment
variable to the index of the entry in pids[] that represents the
relevant child process.  This can be used in rudimentary load
distribution systems.
(slot_var_name): the name of the variable to use (selected by
--process-slot-var).
(enum LongOptionIdentifier): Unique identifiers for long options
with no short option equivalent (--process-slot-var is the first).
(longopts): Add --process-slot-var.
(add_proc): return the index within pids[] that we selected.
(main): Pass &option_index to getopt_long (option_index is a new
variable) in order to identify which long option was passed.
Handle --process-slot-var.
(prep_child_for_exec): Call set_slot_var.
(usage): Mention --process-slot-var.
* doc/find.texi (xargs options): Document --process-slot-var.
* xargs/xargs.1: Likewise.
* NEWS: Mention this change.

Signed-off-by: James Youngman <jay@gnu.org>
2011-05-15 18:23:24 +01:00
James Youngman
61f4abb5be Describe xargs options in alphabetical order.
* xargs/xargs.1: Re-order the options to place them in
alphabetical order.
* xargs/xargs.c (usage): Describe the options in alphabeitcal
order.
* NEWS: Mention this change.
2011-05-15 17:50:42 +01:00
James Youngman
f8639bfc30 xargs/xargs.1: Refer to signal(7) rather than signal(2). 2010-05-09 20:32:00 +01:00
John Gilmore
43bc475fe6 xargs: patch for varying parallelism
Increase/decrease parallelism with SIGUSR1 and SIGUSR2.

Signed-off-by: James Youngman <jay@gnu.org>
2010-05-09 19:48:24 +01:00
James Youngman
773a25dd7d Simplify the wording in the manpage description of "xargs -i".
* xargs/xargs.1: Simplify the wording in the description of "xargs
-i".

Signed-off-by: James Youngman <jay@gnu.org>
2010-02-22 00:30:56 +00:00
James Youngman
2392eedaea Typo fix: "prarallel". 2009-07-12 21:54:32 +01:00