I am not sure how this helps,for example,lets say there a file name "Data.h" in our list of files,and there is a file "foo.c" which has #include "data.h"(observe the case-sensitivty for letter "d").Now I want to print the file name and the #include line.Can anyone give a sample code or atlease suggest a correct algorithm?
| [reply] |
Sounds like you're looking for functionality like this:
ls -1 | while read filename; do grep -ir "$filename" * | grep -v "$fil
+ename" ; done
(However, this is not perl :) | [reply] [d/l] |
Thanks for reply but that is not what I need.
I have a data.txt file which contains a flat list of all the files ,now I want to grep each and every file in this data.txt in a dir(and sub dir) and print those files and the corresponding lines that has case-mismatches.Can you or anyone pls give me any sample code or an algorithm and I can try to implement in perl
| [reply] |