Script To Remove Files Made Either By Python Or Git

Marko Rauhamaa marko at pacujo.net
Fri Oct 9 11:05:55 EDT 2015


Chris Angelico <rosuav at gmail.com>:

> On Sat, Oct 10, 2015 at 1:01 AM, Grant Edwards
> <invalid at invalid.invalid> wrote:
>> $ rm $(find . <find-options-go-here>)

This is not safe since find might return pathnames with spaces in them.

Also, the command fails if find should produce no matches.

> Or if you're using GNU find:
>
> $ find <find-options-go-here> -delete

This is safe.


Marko



More information about the Python-list mailing list