Blog
Recursive Grep On Multiple File Types
Date: 19/4/2007
This is how I script a recursive grep for source code:
find . \( -iname "*.cpp" -or -iname "*.h" \) -exec grep -nH "$1" {} \;
There might be a way of automating the list of extensions to search, or letting the user supply that in a command line argument but my script foo is not up to converting that to the argument format required by "find".
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]