bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61009] xargs need option to immediately stop on command fail


From: anonymous
Subject: [bug #61009] xargs need option to immediately stop on command fail
Date: Tue, 10 Aug 2021 04:57:02 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #8, bug #61009 (project findutils):

[comment #7 comment #7:]
> The idiom 'find -type f | xargs -IX cp X ...' is per se unsafe:
> `xargs -I` reads the input line by line - but yes, files can
> have a newline in their name!

> Alternatively, use 'find ... -print0 | xargs -0 ...' instead.

Newlines in file names - of course. I forgot about it :-). But we can use
-print0/-0 for this. No problem. -exec find option is good, but it can cause
complex contructs with parentheses and etc. For simple cases -exec is good.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61009>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]