This is a port of GNU grep 2.27 to MSDOS/DJGPP.
This is GNU grep, the "fastest grep in the west".
GNU grep is based on a fast lazy-state deterministic matcher (about
twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper
search for a fixed string that eliminates impossible text from being
considered by the full regexp matcher without necessarily having to
look at every character. The result is typically many times faster
than Unix grep or egrep. (Regular expressions containing backreferencing
will run more slowly, however.)
DJGPP specific changes.
- The directory under inspection has two file descriptors associated to it.
But when the directory is left only one of them is closed thus the pool of
descriptors become exhausted if the directory tree contains more than 234
(= 254 - 20) directories. This produces then an error message like this:
grep: dir1/dir2/foobar: Too many open files (EMFILE)
This has been fixed by recording the descriptor that remains open and that
now is closed when the directory is left.
- On DOS, CWD is global, so the starting directory must be recorded, to be
able to restore and return to it in case the program gets interrupted by
SIGINT or similar. To this purpose a signal catcher has been added.
- The port has been tested by using it. I have used it on WinXP only.
It has worked flawlessly. I do not konw if this will ever be the case on
FreeDOS. I have never used/tested them in that environment.
- The port has been configured and compiled on WinXP SP3 and Win98SE using
gcc346b and bnu227b. There is no guarantee that this may be possible with
any other DOS-like OS. Due to the massive use of long file names it will
not be possible to configure and compile without LFN support.
- The port does not provide NLS support.
- The port has been configured with perl-regexp (pcre) support enabled.
This means that you will have to install pcre libray available as:
if you decide to compile the the preconfigured sources. If you prefer
to disable the pcre support you will have to reconfigure and recompile
the sources again, but this time passing the "no-pcre" command line
option to config.bat. The zip file contains only the one build with
perl-regexp support enabled.
I have tried to configure with pcr1021b but the configuration step failed,
so that pcre839b has been used.
As usual, all djgpp specific files (diffs, README files, etc.) are stored in
the /djgpp directory. The sources have been configured to be build in the
/_build directory. If for some reason it does not work for you, delete its
contents and configure from scratch again.
For further information about GNU grep please read the info docs and NEWS file.
This is a verbatim extract of the NEWS file (multi-byte specific features are
not supported by the DJGPP port):
* Noteworthy changes in release 2.27 (2016-12-06) [stable]
** Bug fixes
grep no longer reports a false match in a multibyte, non-UTF8 locale
like zh_CN.gb18030, with a regular expression like ".*7" that just
happens to match the 4-byte representation of gb18030's \uC9, the
final byte of which is the digit "7".
[bug introduced in grep-2.19]
grep by default now reads all of standard input if it is a pipe,
even if this cannot affect grep's output or exit status. This works
better with nonportable scripts that run "PROGRAM | grep PATTERN
>/dev/null" where PROGRAM dies when writing into a broken pipe.
[bug introduced in grep-2.26]
grep no longer mishandles ranges in nontrivial unibyte locales.
[bug introduced in grep-2.26]
grep -P no longer attempts multiline matches. This works more
intuitively with unusual patterns, and means that grep -Pz no longer
rejects patterns containing ^ and $ and works when combined with -x.
[bugs introduced in grep-2.23] A downside is that grep -P is now
significantly slower, albeit typically still faster than pcregrep.
grep -m0 -L PAT FILE now outputs "FILE". [bug introduced in grep-2.5]
To output ':' and tab-align the following character C, grep -T no
longer outputs tab-backspace-':'-C, an approach that has problems if
run inside an Emacs shell window. [bug introduced in grep-2.5.2]
grep -T now uses worst-case widths of line numbers and byte offsets
instead of guessing widths that might not work with larger files.
[bug introduced in grep-2.5.2]
grep's use of getprogname no longer causes a build failure on HP-UX.
grep no longer reads the input in a few more cases when it is easy
to see that matching cannot succeed, e.g., 'grep -f /dev/null'.
The port consists of the usual three packages produced using djdev205
that can be downloaded from ftp.delorie.com and mirrors as (time stamp 2016-12-10):
grep 2.27 binaries, info and man format documentation:
grep 2.27 dvi, html, pdf and ps format documentation:
grep 2.27 source:
Send grep specific bug reports to <firstname.lastname@example.org>.
Send suggestions and bug reports concerning the DJGPP port to
comp.os.msdos.djgpp or <email@example.com>.
If you are not sure if the failure is really a grep failure
or a djgpp specific failure, report it here and *not* to
Guerrero, Juan Manuel <firstname.lastname@example.org>