in reply to Recursively blowing away directories of a certain name

Don't use Perl if something else can do it better. A shell example could be:

rm -rf $(find . -type d -name '_vti_cnf')

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: Recursively blowing away directories of a certain name
by revdiablo (Prior) on Nov 26, 2003 at 20:08 UTC

    If we're doing shell script, we might as well make it robust. Your solution is probably the simplest way, and will work most of the time, but will blow up if there're too many directories to fit on one command line. xargs solves this nicely:

    find . -type d -name '_vti_cnf' | xargs rm -rf

    Or, if there are funky characters in the directory names, a while read loop is what I would use:

    find . -type d -name '_vti_cnf' | while read dir ; do rm -rf "$dir" ; done