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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
-printf (Score:1)
Gnu Find has a
-printfaction which you can use to emit just the names of the directories, like this:find -name '*.xml' -printf '%h\n' | uniq
I don't think it's possible to avoid the
uniqthough;-prunesounds promising, but isn't quite right to be useful here. So for a directory with lots of XML files in it, once it's found the first one and told you the directory you have to sit there and wait while it tells you again for all the others.Or the Unix equivalent: (Score:2)
Re: (Score:1)
Ovid is running this on a pretty big tree, so
-execisn’t a very good idea. Is this a Unix withoutxargs?Re: (Score:1)
Re:Or the Unix equivalent: (Score:1)
Hm, good point. I guess
sedwould have to do in that case:Reply to This
Parent
Re: (Score:1)
Err, and the “
t; d;” part in the sed script isn’t even necessary.