home::grep

grep.py

In the quest of having a grep utility for the windows platform without the need to install cygwin I wrote grep.py.

News

14 january 2003 The first release of grep.py is available for download.

Documentation

The goal of the grep.py script is to works as grep as much as possible. There is some small differences and some feature that grep.py do not yet support.

Here is the list of supported flag of grep.py:
-i, --ignore-case
 ignore case distinctions
-B, --before-context=NUM
 print NUM lines of leading context
-A, --after-context=NUM
 print NUM lines of trailing context
-C, --context=NUM
 print NUM (default 2) lines of output context unless overridden by -A or -B
-n, --line-number
 print line number with output lines
-V, --version print version information and exit --help display this help and exit

Download

Here you can download the latest version of grep.py. As grep.py is a Python script you will need a python distribution to run it.

To allow you to pipe commands without typing command like:

cat file.txt | python.exe grep.py pattern

You can wrap the call to grep.py in a batch file grep.bat. With that batch the following commmand should work:

cat file.txt | grep pattern

last update: 17/09/2004 10:34:16