[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a De
From: |
James Youngman |
Subject: |
[bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed |
Date: |
Wed, 23 Feb 2022 12:59:53 -0500 (EST) |
Follow-up Comment #5, bug #62043 (project findutils):
Andreas writes:
OTOH I am trying to fix the documentation of xargs' inconsistent behavior,
imho these two commands should produce identical output both for consistency
reasons and according to the documentation but do not:
printf '\n' | xargs -r echo foo
printf '\0' | xargs -0 echo foo
These are not supposed to behave similarly. In its default mode (without -d
or -0), xargs does whitespace and quote processing. Like so:
horizon:~$ printf 'one "item two is long" three' | xargs -n1 echo foo
foo one
foo item two is long
foo three
horizon:~$ printf 'one "item two is long" three' | xargs -n1 -d '\n' echo
foo
foo one "item two is long" three
So the input "\n" has contains one (empty) arg with -d "\n" and contains no
args in the default mode, and contains one arg (a newline) with -0.
You're right though; if the documentation does not make this clear, we should
fix the documentation.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62043>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed, Paul Eggert, 2022/02/13
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed, Andreas Metzler, 2022/02/13
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed, Andreas Metzler, 2022/02/13
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed, Stephane Chazelas, 2022/02/23
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed, Andreas Metzler, 2022/02/23
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed,
James Youngman <=
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed, Stephane Chazelas, 2022/02/23
- [bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed, Andreas Metzler, 2022/02/24