Poor Window's man grep in Perl
Sprache: English
Programmiersprache: Perl
Veröffentlicht von: Laufer
Letzte Änderung: 06.09.2007
Aufrufe: 1
Beschreibung
This snippet is actually a tool I'm using when crawling through the Microsoft (and other) include files. You need ActivePerl 5.8.x installed on your machine in order to run it.
It needs two parameters, search path from where it will start recursive hunt and second parameter string in form of Perl regular expression, i.e. what are you looking for. You'll see one example in the very top of it what I'm sometimes doing :)
Oh, yes, the third parameter, if you specify, will filter out uninteresting files.
For example, in order to search C:\Program Files for line beginning with #define, but only in c and cpp files (and ATL macros) you'll key in the following:
rf "C:\Program Files" "(?:^\s*\#define)" "(?:\.c|\.cpp\.h|\.hpp|\.inc|\.cxx|\.hxx)$"
BTW, you can always download CygWin or UnxUtils, but we need more control, right? :)))
Code
Noch kein Kommentar vorhanden
Dieses Snippet kommentieren
Name *
E-Mail (wird nicht angezeigt) *
Website
Kommentar *
Sicherheitscode *