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

anonymous <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.