[comp.unix.aux] Minor incompatibility between Cnews and A/UX

alexis@panix.uucp (Alexis Rosen) (06/23/91)

Maybe this is obvious to other A/UX users, but it wasn't to me. There's some
possibility that this affects other, non-A/UX sites as well.

The Cnews "queuelen" script varies depending on which type of uucp your
system has. The seemingly correct version to tell Cnews about is "ancient".
At first glance the resulting queuelen script seems fine. But in fact, it's
missing a period in one place, which results in its always returning zero.

Here is the original line (it's the last line in the script):
	ls | egrep "^C\.$site$grade....\$" | wc | awk '{print $1}'

and here is the way it should look:
	ls | egrep "^C\.$site$grade.....\$" | wc | awk '{print $1}'
	                           ----^

A/UX has a _really_ _BAD_ UUCP, it's true, but I doubt that they bothered
to hack the code just to add one more character to the UUCP file names. So
it's possible that this is a Cnews bug which affects all users of ancient-
uucp systems.

Also, quite interestingly, I've discovered that egrep seems to be _much_
slower than grep at doing this. res@colnet.uucp (Rob Stampfli) first mentioned
that this was true on a Unix-PC, and it's true on Macs as well. Perhaps it's
System V-dependant? Or is this just a special case where egrep is unusually
slow?

---
Alexis Rosen
Owner/Sysadmin, PANIX Public Access Unix, NY
alexis@panix.com
{cmcl2,apple}!panix!alexis

henry@zoo.toronto.edu (Henry Spencer) (06/25/91)

In article <1991Jun23.132007.10674@panix.uucp> alexis@panix.uucp (Alexis Rosen) writes:
>The Cnews "queuelen" script varies depending on which type of uucp your
>system has. The seemingly correct version to tell Cnews about is "ancient"...
>... here is the way it should look:
>	ls | egrep "^C\.$site$grade.....\$" | wc | awk '{print $1}'
>	                           ----^
>
>A/UX has a _really_ _BAD_ UUCP, it's true, but I doubt that they bothered
>to hack the code just to add one more character to the UUCP file names...

Somebody did, somewhere.  I can assure you that a truly ancient uucp had
only four characters in that position in the names; I ran such a uucp for
nearly a decade.

>Also, quite interestingly, I've discovered that egrep seems to be _much_
>slower than grep at doing this...
>...true on a Unix-PC, and it's true on Macs as well. Perhaps it's
>System V-dependant? Or is this just a special case where egrep is unusually
>slow?

On my system the difference is too small to measure.  It may be a SysVism,
although it has always been true that grep can be faster than egrep for
complex patterns on small inputs.
-- 
"We're thinking about upgrading from    | Henry Spencer @ U of Toronto Zoology
SunOS 4.1.1 to SunOS 3.5."              |  henry@zoo.toronto.edu  utzoo!henry

paul@taniwha.UUCP (Paul Campbell) (06/25/91)

In article <1991Jun23.132007.10674@panix.uucp> alexis@panix.uucp (Alexis Rosen) writes:
>Also, quite interestingly, I've discovered that egrep seems to be _much_
>slower than grep at doing this.

this is why there are 3 greps fgrep is faster than grep is faster than egrep,
they all use different pattern matching algorithms ..... 

	Paul

-- 
Paul Campbell    UUCP: ..!mtxinu!taniwha!paul     AppleLink: CAMPBELL.P

Tom Metzger's White Ayrian Resistance has been enjoined to stop selling Nazi
Bart Simpson t-shirts - Tom of course got it wrong, Bart is yellow, not white.

scs@iti.org (Steve Simmons) (06/26/91)

alexis@panix.uucp (Alexis Rosen) writes:

>Also, quite interestingly, I've discovered that egrep seems to be _much_
>slower than grep at doing this. res@colnet.uucp (Rob Stampfli) first mentioned
>that this was true on a Unix-PC, and it's true on Macs as well. Perhaps it's
>System V-dependant? Or is this just a special case where egrep is unusually
>slow?

It's something horrible in some versions of sysV egrep.  On a UNIX-PC
some C-News scripts simply will not run due to grep/egrep problem.  I
strongly recommend getting GNU grep/egrep and replacing the 3b1 grep
with them.  If AUX has the same problem, a similar fix applies.
-- 
  "If we don't provide support to our users someone is bound to
   confuse us with Microsoft."
	-- Charles "Chip" Yamasaki

wwm@wa8tzg.mi.org (Bill Meahan) (06/26/91)

In article <scs.677869448@wotan.iti.org> scs@iti.org (Steve Simmons) writes:
>alexis@panix.uucp (Alexis Rosen) writes:
>
>>Also, quite interestingly, I've discovered that egrep seems to be _much_
>>slower than grep at doing this. res@colnet.uucp (Rob Stampfli) first mentioned
>>that this was true on a Unix-PC, and it's true on Macs as well. Perhaps it's
>>System V-dependant? Or is this just a special case where egrep is unusually
>>slow?
>
>It's something horrible in some versions of sysV egrep.  On a UNIX-PC
>some C-News scripts simply will not run due to grep/egrep problem.  I
>strongly recommend getting GNU grep/egrep and replacing the 3b1 grep
>with them.  If AUX has the same problem, a similar fix applies.
>-- 
>  "If we don't provide support to our users someone is bound to
>   confuse us with Microsoft."
>	-- Charles "Chip" Yamasaki

Hmmm.  On MY late-model ;-) 3B1 (one of the last) under both 3.51a and
3.51m I've had NO particular problems with C-News.  Never modified any
scripts, never replaced any code.  Just plain ol' C-News.

Of course, I don't try to get a FULL feed here, just 40-50 groups :-)
-- 
Bill Meahan (WA8TZG)             |   I taught my daughter's cat a trick!!
wwm@wa8tzg.mi.org  OR            |   I say to her, "Velcro! Ignore me."
uunet!mailrus!sharkey!wa8tzg!wwm |   And she DOES!!  For hours at a time!!
"Home for Cybernetic Orphans"    |   What a smart cat.

alexis@panix.uucp (Alexis Rosen) (06/26/91)

paul@taniwha.UUCP (Paul Campbell) writes:
>alexis@panix.uucp (Alexis Rosen) writes:
>>Also, quite interestingly, I've discovered that egrep seems to be _much_
>>slower than grep at doing this.
>
>this is why there are 3 greps fgrep is faster than grep is faster than egrep,
>they all use different pattern matching algorithms ..... 

According to my beat-up copy of Kernighan and Pike, egrep is faster than
grep. Why else would Henry & Geoff have used it?

BTW, how good is Gnu's grep, compared to the standard SVR2.2?

---
Alexis Rosen
Owner/Sysadmin, PANIX Public Access Unix, NY
alexis@panix.com
{cmcl2,apple}!panix!alexis

henry@zoo.toronto.edu (Henry Spencer) (06/26/91)

In article <878@taniwha.UUCP> paul@taniwha.UUCP (Paul Campbell) writes:
>>Also, quite interestingly, I've discovered that egrep seems to be _much_
>>slower than grep at doing this.
>
>this is why there are 3 greps fgrep is faster than grep is faster than egrep,

Not true.  For small jobs, grep is sometimes the fastest of the lot,
competing with egrep, and fgrep is *dead last*.  For big jobs, egrep is
usually fastest *unless* you are searching for a bunch of fixed strings,
in which case fgrep wins.

The slow-egrep problem originally discussed here is a bug, not a feature.
-- 
"We're thinking about upgrading from    | Henry Spencer @ U of Toronto Zoology
SunOS 4.1.1 to SunOS 3.5."              |  henry@zoo.toronto.edu  utzoo!henry

d88-jwa@byse.nada.kth.se (Jon W{tte) (06/26/91)

In article <878@taniwha.UUCP> paul@taniwha.UUCP (Paul Campbell) writes:

   >Also, quite interestingly, I've discovered that egrep seems to be _much_
   >slower than grep at doing this.

   this is why there are 3 greps fgrep is faster than grep is faster than
   egrep, they all use different pattern matching algorithms ..... 

Here we go again:

fgrep is _NOT_ faster than egrep except for small inputs. Fgrep is
mostly a convenience utility, to be able to match dots & stuff with
ease.

--
						Jon W{tte
						h+@nada.kth.se
						- Speed !

tony@tui.marcam.dsir.govt.nz (Tony Cooper) (06/27/91)

In article <1991Jun26.151645.888@panix.uucp>, alexis@panix.uucp (Alexis
Rosen) writes:
|> BTW, how good is Gnu's grep, compared to the standard SVR2.2?

% timex fgrep zzzzz /FILES

real        0.28
user        0.06
sys         0.20

% timex /usr/bin/fgrep zzzzz /FILES

real        2.46
user        2.13
sys         0.21

(all files cached in RAM). And there's no need to ask which is the GNU fgrep
and which is the SVR2 one, right?

Cheers,
Tony