Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Sunday April 09, 2006
10:56 AM

You don't always need Perl

[ #29267 ]

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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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.