LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] grep, egrep, fgrep

[ILUG] grep, egrep, fgrep

Padraig Brady Padraig at AnteFacto.com
Fri Feb 2 15:12:31 GMT 2001


Hmm this is interesting.

pixelbeat at pixelbeat:~$ ls -li /bin/ls /bin/dir /bin/vdir
1120272 -rwxr-xr-x    1 root     root       40848 Jan  5 14:10 /bin/dir
1120274 -rwxr-xr-x    1 root     root       40848 Jan  5 14:10 /bin/ls
1120280 -rwxr-xr-x    1 root     root       40848 Jan  5 14:10 /bin/vdir

I don't agree that they should be different files.
Why would you ever want to rename dir/ls/vdir/grep/fgrep/egrep/... ?
maybe if you had links with a different name but why?
What would be more appropriate in my opinion would be to return
an error if argv[0] wasn't one of the accepted values.

Padraig.

Scanlan, Brian (5188) wrote:

> 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 !)





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell