On Mon, 2003-05-26 at 19:39, jqdkf@zju.edu.cn wrote: > Hi, > > I'm just wondering why grep still exists in every distribution of UNIX > or UNIX like system. As egrep can support a full featured regular > expression, it is much more powerful than grep. Is it only for backport > support? I'd suspect that it exists because if you look at /bin/egrep or /bin/fgrep, they are both merely wrapper shell scripts for /bin/grep with the appropriate controlling option. while they are a bit more complicated in implementation, zgrep, zegrep and zfgrep are also scripts calling the appropriate code. Most implementations of egrep or fgrep I've encountered either are implemented essentially this way, or as a link to an edition of grep that checks how it was called to determine if the -E or -F options should be implied and applied. That is part of the underlying strength of the concepts on which Unix(R) style systems are based. (Unix(R) is a trademark of The Open Group) -- Mark L. Kahnt, FLMI/M, ALHC, HIA, AIAA, ACS, MHP ML Kahnt New Markets Consulting Tel: (613) 531-8684 / (613) 539-0935 Email: kahnt@hosehead.dyndns.org
Attachment:
signature.asc
Description: This is a digitally signed message part