You don't always need Perl

brian_d_foy on 2006-04-09T15:56:49

Today, I got an "urgent" message from someone who desperately needs to delete all of the CVS directories below the main directory. How do you do this in Perl, he says (urgently)?

Well, you don't. I answered his question because its pretty easy. If I had to think about it, I would just move to the next "urgent" question waiting for me.

Just use the right CVS command.

$ cvs export ...


Or, if you don't like that (maybe you don't have access to the repository), a little command line magic works.

$ find . -name CVS | xargs rm -rf


Sometimes you always need Perl

ferreira on 2006-04-09T18:35:47

In *nix, you might use as well
$ find . -name CVS -type d -exec rm -rf '{}' \;

But if you must use a feature-challenged OS, you may find that perl is as handy as it gets.

c:> find2perl . -name CVS -type d -exec rm -rf '{}' \; > rm-cvs.pl
c:> perl rm-cvs.pl

And that reminded why PPT was a good idea some day. It makes part of the world domination plan.