Hey,
This is on RH 6.1 and 6.2...
# ls -ali /bin/grep /bin/egrep /bin/fgrep
16537 -rwxr-xr-x 1 root root 47452 Mar 21 1999 /bin/egrep
16538 -rwxr-xr-x 1 root root 47452 Mar 21 1999 /bin/fgrep
16539 -rwxr-xr-x 1 root root 47452 Mar 21 1999 /bin/grep
Oooh, same sized file. Diff reckons they're different though.
# diff /bin/egrep /bin/grep
Binary files /bin/egrep and /bin/grep differ
Hmm. Let's get a strings output...
# strings /bin/egrep >/tmp/egrep.strings
# strings /bin/fgrep >/tmp/fgrep.strings
# diff /tmp/egrep.strings /tmp/fgrep.strings
272c272
< egrep
---
> fgrep
Is it just me, or are these three binarys the exact same apart
from a string containing their name, it'd be silly if they don't
act as their argv[0] says they should.
Though this guy disagrees.
http://mail.gnu.org/pipermail/bug-gnu-utils/2000-January/000616.html
Brian.
-----Original Message-----
From: Niall O Broin [mailto:niall at magicgoeshere.com]
Sent: 02 February 2001 14:04
To: ilug at linux.ie
Subject: [ILUG] grep, egrep, fgrep
Can anyone shed any light on why the above, at least on SuSE 6.4, are
entirely separate programs ? As egrep is e.g functionally identical to grep
-E and the man page for grep says
In addition, two variant programs egrep and fgrep are available. Egrep is
the same as grep -E. Fgrep is the same as grep -F.
why are grep, egrep, and fgrep not just links to the same file, and the
program decides what to do according to its name as is quie common behaviour
with Gnu tools ?
This anomalous behaviour has just cost me a couple of blank CDs and more
important, a couple of hours, so I'm pissed ! (Yes, I know it's my fault for
making unjustified assumptions, but I'm still pissed !)
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!