CFT: BSD-licensed grep [Fwd: cvs commit: ports/textproc/bsdgrep Makefile distinfo]

Gabor Kovesdan gabor at
Sat Jun 14 23:43:25 UTC 2008

Hello All,

Today I've basically terminated te feature-completion of the 
BSD-licensed grep from OpenBSD. It means, that I've accomplished the 
following tasks:
- Implement --label
- Implement --null
- Implement --color / --colour
- Implement -D / --devices
- Implement -H / --with-filename
- Implement -J / --bz2decompress
- Implement -d / --directories
- Implement -m / --max-count
- Implement -o / --only-matching
- Add --help
- Eliminate warnings
- style(9) cleanup

I've made some preliminary tests with the fgrep and normal grep 
behaviour and it seems that they can achieve the same speed:

/usr/bin/time -h gnugrep -e ^\#define -r /usr/include/
        24.06s real             0.11s user              0.17s sys
        24.46s real             0.11s user              0.16s sys
        24.37s real             0.11s user              0.16s sys
        23.73s real             0.09s user              0.19s sys
        23.97s real             0.06s user              0.21s sys

/usr/bin/time -h bsdgrep -e ^\#define -r /usr/include/
        23.56s real             0.27s user              0.23s sys
        23.40s real             0.28s user              0.21s sys
        23.64s real             0.30s user              0.18s sys
        23.70s real             0.30s user              0.23s sys
        23.92s real             0.28s user              0.22s sys

/usr/bin/time -h gnugrep -e int -r /usr/include/
        18.44s real             0.10s user              0.14s sys
        18.19s real             0.09s user              0.14s sys
        18.01s real             0.09s user              0.15s sys
        18.10s real             0.10s user              0.14s sys
        18.91s real             0.06s user              0.18s sys

/usr/bin/time -h bsdgrep -e int -r /usr/include/
        18.39s real             0.12s user              0.19s sys
        18.33s real             0.14s user              0.17s sys
        18.26s real             0.11s user              0.20s sys
        18.07s real             0.10s user              0.21s sys
        17.97s real             0.14s user              0.16s sys

What remains is to do more test about the performance and the 
compatibility with the GNU version. You can test this version easily by 
installing the textproc/bsdgrep port, which creates two symlinks:
bsdgrep points to this version and gnugrep points to the base grep.

Any help and comments are welcome.

Gábor Kövedán

P.S.: Acknowledgements are going to Max Khon, who is my mentor in this 
program, to Diomidis Spinellis due to the his useful comments and to 
Sean C. Farley who worked on this implementation of grep before and 
provided some preliminary comments and suggestions before I started 
working on this project, and of course, to Google for sponsoring this 
piece of work.
-------------- next part --------------
An embedded message was scrubbed...
From: Gabor Kovesdan <gabor at>
Subject: cvs commit: ports/textproc/bsdgrep Makefile distinfo
Date: Sat, 14 Jun 2008 23:06:19 +0000 (UTC)
Size: 3095

More information about the freebsd-current mailing list