News for hackers. Stuff that matters.
Re:The History of the Design of Unix’s Find Command (1995) by jschwartzi on Friday October 02, 2015 @12:20PM (#10319460)
xargs is very powerful when you want to run one command with many arguments, but each argument is newline-delimited. That's basically all I use it for, and it saves me a lot of looping and subshell creation.

For example, when purging backups from Mercurial after a revert:

find . -name *.orig | xargs rm

Re:The History of the Design of Unix’s Find Command (1995) by icebraining on Friday October 02, 2015 @12:22PM (#10319475)
But that's exactly it - if any of the filenames have spaces, that will fail, since xargs will try to delete each part separately. From the man page:

Because Unix filenames can contain blanks and newlines, this default behaviour is often problematic; filenames containing blanks and/or newlines are incorrectly processed by xargs.

Re:The History of the Design of Unix’s Find Command (1995) by johnwfinigan on Friday October 02, 2015 @02:03PM (#10320170)
Excluding filenames containing newlines, I wonder how many weird corner cases this would reveal:

    ls | tr '\n' '\0' | xargs -0 rm
I've been annoyed by ls and xargs not playing together here and there, but the above only just occurred to me. Not sure if it's a good idea yet or not!
Re:The History of the Design of Unix’s Find Command (1995) by zb on Friday October 02, 2015 @03:22PM (#10320653)
find . -name '*.orig' -delete