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

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.
  • Gnu Find has a -printf action 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 uniq though; -prune sounds 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.