home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] is "xargs" really still useful just for limiting command line size?

  • Subject: Re: [OCLUG-Tech] is "xargs" really still useful just for limiting command line size?
  • From: Dianne Skoll <dfs [ at ] roaringpenguin [ dot ] com>
  • Date: Fri, 16 Mar 2018 10:09:59 -0400
On Fri, 16 Mar 2018 09:27:21 -0400 (EDT)
"Robert P. J. Day" <rpjday [ at ] crashcourse [ dot ] ca> wrote:

>   course i taught recently had a section on "xargs", emphasizing its
> value(?) in being able to run a command in bite-size pieces but, these
> days, is that really that much of an issue?

Yes.

>   $ find . -type f -name core | xargs rm -f

That can fail in subtle ways.

> i would simply assume i can generate a really long command and write:
>   $ rm -f $(find . -type f -name core)

That can also fail in subtle ways.

Finding out why both of those are wrong is left as an exercise for the
reader. :)

Regards,

Dianne.