On Fri, 30 Jul 2004, Andrew Gaffney wrote:
I think you misunderstand. I don't want to delete the files that contain '<%perl>' or '<%init>'. I just want to make a list of all .html files in a directory tree and remove the ones that contains '<%perl>' or '<%init>' from my list.
Then yes, I misunderstood. This version should do what you want:
$ find /path/to/htdocs -type f | xargs egrep -liv '<%(perl|init)>'
It's exactly like the first one I sent before, but I've added "-v" to the egrep arguments, which inverts the meaning from "all files with this pattern" to "all files NOT with this pattern". In this case, that's what you're trying to get.
If you then want to remove / delete files, tack on the sed & rm commands I had in the earlier version, but it sounds like you just mean "omit from the list" rather than "remove from the hard drive".
-- Chris Devers
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>