Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hropus.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!hropus!jrw From: jrw@hropus.UUCP (Jim Webb) Newsgroups: net.micro.att Subject: Re: UNIX PC command surprises... Message-ID: <379@hropus.UUCP> Date: Mon, 24-Mar-86 18:04:17 EST Article-I.D.: hropus.379 Posted: Mon Mar 24 18:04:17 1986 Date-Received: Thu, 27-Mar-86 06:59:50 EST References: <351@hropus.UUCP> <888@kitty.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 33 > In article <351@hropus.UUCP>, jrw@hropus.UUCP (Jim Webb) (me) writes: > > Has anyone else out there noticed that on the "7300" the > > grep, egrep, and fgrep commands are IDENTICAL. > > > > Boy, and to think that people pay extra to get egrep > > with the Development Set.... > > Aw, come on! *THINK* I'm suprised that you haven't discovered that > ``edit'', ``ex'', and ``vi'' are also identical and are linked together. Does > that mean they are the same? > In case you still don't know the answer... In an program, argv[0] is > the NAME by which the program was invoked. Since the source code for grep and > egrep is very similar, the same compiled program is used, with the argv[0] > being used to switch the internal program logic. The same situation is also > used for the above editors. Golly gee...that's why cp and ln are linked as well! Boy, am I learning stuff today! NOW, IF ONLY THE GREP COMMANDS *WORKED* ON THE 7300 THE WAY THEY ARE SUPPOSED TO, I WOULD BELIEVE THAT THEY LOOKED AT ARGV[0] BUT SINCE THEY DON'T I DON'T BELIEVE YOUR LITTLE PROGRAMMING EXAMPLE DOES ANYTHING FOR MY GRIPE. Why don't you go login to a 7300 some time and test out an egrep expression like I stated above (nproc|NPROC) and you will see that it does not work. Also, egrep is a yacc/lex program in ATT System V while grep is written in straight C so I don't know how it is so similar. Sorry to take up so much room here... -- Jim Webb ihnp4!houxm!hropus!jrw