News for hackers. Stuff that matters.
Re:How is GNU `yes` so fast? by teapot01 on Tuesday June 13, 2017 @10:04AM (#14544744)
I know its only an example but why

   yes | rm -r <>
and not

    rm -rf <>
Re:How is GNU `yes` so fast? by mooktakim on Tuesday June 13, 2017 @10:35AM (#14544981)
I believe "yes" has become less useful over the years, with flags like force and quiet solves this now.
Re:How is GNU `yes` so fast? by x1798DE on Tuesday June 13, 2017 @10:12AM (#14544796)
I think rm -rf would also suppress errors in addition to confirmation messages, so presumably if you want a "soft" force...
Re:How is GNU `yes` so fast? by eridius on Tuesday June 13, 2017 @03:34PM (#14547874)
No it doesn't.

  > rm -rf foo/bar
  rm: foo/bar: Permission denied
Re:How is GNU `yes` so fast? by mnarayan01 on Wednesday June 14, 2017 @09:11AM (#14552434)
If foo/bar does not exist, it should be silent. Via http://pubs.opengroup.org/onlinepubs/007904975/utilities/rm.... on the -f option:

> [...] Do not write diagnostic messages or modify the exit status in the case of nonexistent operands. [...]

Re:How is GNU `yes` so fast? by eridius on Wednesday June 14, 2017 @01:44PM (#14554474)
Yes, but that's the only error it suppresses, and that's because "not existing" isn't really an error for a tool that's trying to delete something. In my example foo/bar existed but I didn't have permissions to delete it, and as you'll see it printed out that error.