[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #55190] xargs documentation is confusing about the usage of -i and
From: |
Bernhard Voelker |
Subject: |
[bug #55190] xargs documentation is confusing about the usage of -i and -I (capital i), and doesn't have any examples on this options |
Date: |
Mon, 10 Dec 2018 09:28:00 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0 |
Follow-up Comment #1, bug #55190 (project findutils):
1)
Regarding the terms "replace" vs. "substitute": for me as non-English-native
speaker,
there's no difference between 'replace' and 'substitute.
Your example can be simplified by avoiding the files AAA.txt and BBB.txt:
it simply reads:
$ echo line | xargs -I {} echo line2
As documented both in the man page and the Texinfo manual - and even in "xargs
--help",
the -I option works on the "initial arguments". Looking at the synopsis
clarifies:
Usage: xargs/xargs [OPTION]... COMMAND [INITIAL-ARGS]...
...
-I R same as --replace=R
-i, --replace[=R] replace R in INITIAL-ARGS with names read
from standard input; if R is unspecified,
assume {}
In your example above, the initial args is the string "line2". So there xargs
cannot replace '{}' because there is none.
2) findutils' info pages _has_ a separate node to explain -I,-e,--replace
incl. examples:
https://www.gnu.org/software/findutils/manual/html_node/find_html/Interspersing-File-Names.html#Interspersing-File-Names
With the above, do you see things in the documentation which could
be improved? Concrete suggestions and patches welcome. ;-)
Have a nice day,
Berny
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55190>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/