I have something like a tree structure of directories, with some of them having inside a file named "Filename". Inside each of these files, there is some information that I would like to access after changing its "look". Here's what I have:
find . - name "Filename" | xargs perl -pe ...(one liner to change "look" of file, and put info i want to grep in one line) | grep "WhatIWantToShow" | egrep "exclude|some|stuff"
This works fine and it outputs the info I pretended. But I also need the directory name for each of the files found, and in which the grep was applied.
Thats now a big headache for me. Im stuck. Would appreciate if you guys can show me some light. Thanks.
| xargs <stuff>by-exec <stuff> {} \; -printf '%h\n'maybe? May require GNUfind.